# Thread: Help with multiple IF statements combined with maybe VLOOKUP???? PLEASE !!!!

1. ## Help with multiple IF statements combined with maybe VLOOKUP???? PLEASE !!!!

Hello I am trying to do what should be a simple formula but for the life of me cannot figure it out.
If Task Code = 280, take Task Code 280 completion date and minus Task Code 20 completion date (provided they have the same notification#). Hope this makes sense.

2. No, it doesn't really make too much sense. What is it you are really trying to achieve? Is task 280 and 20 the only two codes you are interested in?

Perhaps repost your sample workbook showing manually entered desired results. Then explain why those are the results.

3. ## IF Statements and VLOOKUP

Originally Posted by NBVC
No, it doesn't really make too much sense. What is it you are really trying to achieve? Is task 280 and 20 the only two codes you are interested in?

Perhaps repost your sample workbook showing manually entered desired results. Then explain why those are the results.
Here you go - does this help?Ezample here states 3 days. Looking for how long between tasks with the same notification #.

4. Still not entirely clear. Am I only looking at the difference between task 20 and task 280 for each notification? What is the result expected for notification # 20011025? Is it 3 also due to date difference between task 20 and 280?

5. ## HELP IF statements with VLOOKUP

Does this help? I have listed the desried results. I need to just foguire out the formula to achieve these results.
Thank you again.

6. Ok. Try:

=IF(B2=280,C2-SUMIFS(\$C\$2:\$C\$20,\$A\$2:\$A\$20,A2,\$B\$2:\$B\$20,20),0)

copied down

7. YES !!!! That worked, I cannot thank you enough, thank you thank you and thank you a ton!!!

8. ## Multiple IF and SUMIFS

Thank you so much for the formula, it works beautifully.
What can I add to this formula if the TaskCode "20" does not exist in the set of data. i.e. look at this file after I have inserted your formula. It has "41920" entry in there twice because I deleted some of the dates that did indeed have a Task Code of "20". What do I do in this instance, that I can add to the formula, so that it will just default to a "0" if Task Code of "20" does NOT exist for that notification#. I hope this makes sense, please see attached.

9. Try:

=IF(B2=280,IF(COUNTIFS(\$A\$2:\$A\$18,A2,\$B\$2:\$B\$18,20)>0,C2-SUMIFS(\$C\$2:\$C\$18,\$A\$2:\$A\$18,A2,\$B\$2:\$B\$18,20),0),0)

or

=IF(AND(B2=280,COUNTIFS(\$A\$2:\$A\$18,A2,\$B\$2:\$B\$18,20)>0),C2-SUMIFS(\$C\$2:\$C\$18,\$A\$2:\$A\$18,A2,\$B\$2:\$B\$18,20),0)

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•