# Issue with date formulas

1. ## Issue with date formulas

Hi!

Fairly new to formulas so forgive me if this is a stupid question

What I'm trying to do is have a cell return a 1 if U3 equals yesterday's date, return a 2 if U3 is more than 1 day greater than yesterday's date, or return a 0 if neither of these are true. I've used the following formula:

=IFERROR(IF(TODAY()-1=INT(U3),1,IF((TODAY()-U3)>1,2),0))

Can attach a sample of the spreadsheet if necessary.

Thanks!  Register To Reply

2. ## Re: Issue with date formulas

What EXACTLY is in cell U3? Is it a date or text? Is it entered manually or derived from a formula?

The spreadsheet would make it easier to diagnose.   Register To Reply

3. ## Re: Issue with date formulas

Hi Ali,

U3 is a manually entered date - a target go-live date for a campaign.

Have attached the spreadsheet I'm working on.

Thanks  Register To Reply

4. ## Re: Issue with date formulas

Try

=IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0))  Register To Reply

5. ## Re: Issue with date formulas

In W3

=IF(ISNUMBER(U3),IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0)),"")

in X3

=IF(ISNUMBER(W3),IF(OR(AND(W3*1=1,Y3=1,M3=1),AND(W3*1=0,Y3=0,M3=1)),1,IF(AND(W3*1=1,Y3=0,M3=1),2,IF(W3=2,3,0))),"")  Register To Reply

6. ## Re: Issue with date formulas Originally Posted by JohnTopley In W3

=IF(ISNUMBER(U3),IF(TODAY()-1=U3,1,IF(TODAY()-U3>1,2,0)),"")

in X3

=IF(ISNUMBER(W3),IF(OR(AND(W3*1=1,Y3=1,M3=1),AND(W3*1=0,Y3=0,M3=1)),1,IF(AND(W3*1=1,Y3=0,M3=1),2,IF(W3=2,3,0))),"")
This works perfectly! Thank you!  Register To Reply