# 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!

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.

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

4. ## Re: Issue with date formulas

Try

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

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))),"")

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!

There are currently 1 users browsing this thread. (0 members and 1 guests)

#### Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1