I am trying to work out an IF statement and getting lost. I am sure I’ve been up too long now but I just can’t see it.
Here is the scenario:
I have a given date in E1, say June 21st (my payday).
I have a day of the month in C22 say the 11th of the month (the day a bill is due).
I have a $value in D22 (the value of the bill).
I need an if statement that is true if the bill is due on or after the date in E1 AND before the date in E1 + 14 days (my next payday).
Here is what I tried (note its a bit mangled from experimenting):
=IF(AND(DATE(YEAR(E$1),MONTH(E$1),DAY($C22))>=E$1,DATE(YEAR(E$1),MONTH(E$1),DAY(E$1)+14))>DATE(YEAR(E$1),MONTH(E$1),DAY($C22)),$D22,"")
Can anyone help me?
Maybe:
(which will show D22, with your example, if 11-Jun >= 21-Jun AND 11-Jun < 21-Jun + 14 days)
Now if you want to show D22 if 11-Jul >= 21-Jun AND 11-Jul < 21-Jun + 14 days, it is more complicated because you need to check if 11 is before or after 21, and increment the month if it is before. You could do it that way: