# Needing an excel formula that has two if/then

Closed
Ginny - Oct 12, 2010 at 11:36 AM
aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 - Oct 15, 2010 at 02:40 PM
Hello,

I'm trying to come up with a formula that will pull data from a different tab, with two if/then statements. I need the data to pull if cell range I2:I56=October, but I only want it to pull if the same tab cell range E2:E56=Rep. I have tried all sorts of formulas and nothing is working. Any help is much appreciated.

Here are my most recent attempts:
=COUNT(IF('Attrition Master'!E2:E56,"Rep")+(IF('Attrition Master'!I2:I56,"October")))
=SUM(IF('Attrition Master'!I2:I56="October",'Attrition Master'!E2:E56="Rep"))
Related:

## 2 responses

sharpman Posts 1021 Registration date Saturday May 23, 2009 Status Contributor Last seen October 20, 2010 183
Oct 15, 2010 at 12:50 PM
have a look at this site, it may help in your query /task

https://www.techonthenet.com/excel/formulas/if_nested.php
aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 491
Oct 15, 2010 at 02:40 PM
Hi,

1)Corresponding to :=COUNT(IF('Attrition Master'!E2:E56,"Rep")+(IF('Attrition Master'!I2:I56,"October"))) try :
=SUMPRODUCT(('Attrition Master'!E2:E56="Rep")*('Attrition Master'!I2:I56="October"))

2) For the second formula, you have to indicate which Range of cells you want to add if the two conditions are OK

Best regards
"Pour trouver une solution à ses problèmes, il faut s'en donner la peine."