Trouble with an IF statement

CSyx

Board Regular
Joined
May 2, 2012
Messages
77
Hello all,

Using Excel 2007

The current formula tests an employee date of hire (P10) for eligibility of benefits and is working perfrectly if I no not have any rehired employees:

=IF(AND(Q10="",S10="",$B$3-P10>=$AO$1),$AO$2,"")

I would like to add to the formula stating if Q10 (rehire date) is NOT blank, S10="",$B$3-Q10>=$AO$1)$AO$2,"")

Just can't seem to get this figured out.

Thanks for the help.
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Well... you've already got the false set as "". So why don't you add two ifs together?

=IF(AND(Q10="",S10="",$B$3-P10>=$AO$1),$AO$2,"")+IF(AND(Q10<>"",S10="",$B$3-P10>=$AO$1),$AO$2,"")
 
Upvote 0
Since you're returning the same result regardless of the value in Q10, drop that check altogether:

=IF(AND(S10="",$B$3-P10>=$AO$1),$AO$2,"")
 
Upvote 0
Thanks for all the help! I used the information everyone posted to get:

=IF(AND(Q45="",S45="",$B$3-P45>=$AO$1),$AO$2,IF(AND(Q45<>"",S45="",$B$3-P45>=$AO$1),$AO$2,""))

And this solved my problem. The support here is outstanding!
 
Upvote 0
But why would you do the second check? The only difference between the two is whether S45 is blank or not, the rest of the comparisons are identical, so the initial check of Q45 is not necessary:

=IF(AND(S45="",$B$3-P45>=$AO$1),$AO$2,"")

should accomplish the same thing.
 
Upvote 0

Forum statistics

Threads
1,213,552
Messages
6,114,278
Members
448,560
Latest member
Torchwood72

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top