Solved how to write if formula between different dates

October 14, 2016 at 09:43:42
Specs: Windows 10
If cell is empty do nothing if cell date is more than this date and less than this date then enter 900 otherwise 999

See More: how to write if formula between different dates

Reply ↓  Report •


#1
October 14, 2016 at 10:06:40
✔ Best Answer
This formula will return:

- An empty cell if A1 is blank
- 900 for any 2015 date in A1
- 999 for any not 2015 date in A1

=IF(A1="","",IF(AND(A1>DATEVALUE("12/31/2014"),A1<DATEVALUE("1/1/2016")),900,999))

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Reply ↓  Report •

#2
October 14, 2016 at 10:25:31
That's great worked just as I wanted it to. I did put the dates into 2 different cells
then entered the cell numbers instead of the date but that didn't work. Is that possible?

Reply ↓  Report •

#3
October 14, 2016 at 10:48:39
If you are using a cell reference, you don't need the DATEVALUE function.

=IF(A1="","",IF(AND(A1>$I$1,A1<$J$1),900,999))

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.

message edited by DerbyDad03


Reply ↓  Report •

Related Solutions

#4
October 14, 2016 at 11:01:33
Much obliged DerbyDad03 Worked great. I thought that it would be easier to alter
the cell values than altering the formula when needed.

Reply ↓  Report •


Ask Question