lionstud31
Board Regular
- Joined
- Oct 16, 2006
- Messages
- 89
is it possible to do an if statement between two dates? For Example: between jan 3rd 2006 and feb 2nd 2006 would make it true, any other dates would make it false.
=AND(A1>=B1,A1<=C1)
=IF(AND(A1>=B1,A1<=C1),TRUE,FALSE)
=AND(DATE(2006,1,15)>=DATE(2006,1,3),DATE(2006,1,15)<=DATE(2006,2,2))
Say the date you are interested in is in A1, the jan3rd date is in B1 and the Feb2nd date is in C1 then:
Code:=AND(A1>=B1,A1<=C1)
Best regards
Richard
EDIT: with IF maybe:
Code:=IF(AND(A1>=B1,A1<=C1),TRUE,FALSE)
but the IF is unnecessary.
Book2.xls | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | Date | Sales | ||||
2 | 01January2006 | 10 | ||||
3 | 15January2006 | 15 | ||||
4 | 01February2006 | 20 | ||||
5 | 15February2006 | 13 | ||||
6 | 01March2006 | 14 | ||||
7 | 15March2006 | 16 | ||||
8 | 01April2006 | 18 | ||||
9 | 15April2006 | 17 | ||||
10 | ||||||
11 | Date1: | 29January2006 | ||||
12 | Date2: | 17March2006 | ||||
13 | SalesBetween: | 63 | ||||
Sheet1 |