Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
If statment
I am trying to write and if statment to include only 2001 dates. However, I
have dates both in 2000 and 2002. I tried the writing the following statment and excel keeps giving me an error: =IF(Date Field=1/1/2000 AND <1/1/2002, TRUE, FALSE) Apparently excel doesn't like the and part. How can I go about getting around this or writing the formula with a new word or character that excel will accept? Thanks, jason |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
If statment
One way with the date in A1:
=and(a1=date(2001,1,1),a1<=date(2001,12,31) or =year(a1)=2001 You don't need the If's for either of these two formulas. These return true or false by themselves. Jason wrote: I am trying to write and if statment to include only 2001 dates. However, I have dates both in 2000 and 2002. I tried the writing the following statment and excel keeps giving me an error: =IF(Date Field=1/1/2000 AND <1/1/2002, TRUE, FALSE) Apparently excel doesn't like the and part. How can I go about getting around this or writing the formula with a new word or character that excel will accept? Thanks, jason -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
If statment
=IF(AND(Date Field=DATE(2000,1,1),Date Field<DATE(2001,1,1)),TRUE,FALSE)
This assumes that what are calling Date Field is a single cell. If you mean a range of dates called Date_Field, (you cannot have spaces in a defined name), then use: =SUMPRODUCT((Date_Field=DATE(2000,1,1))*(Date_Fie ld<DATE(2002,1,1))) Which will count the number of date cells that fall within your required range. -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Jason" wrote in message ... I am trying to write and if statment to include only 2001 dates. However, I have dates both in 2000 and 2002. I tried the writing the following statment and excel keeps giving me an error: =IF(Date Field=1/1/2000 AND <1/1/2002, TRUE, FALSE) Apparently excel doesn't like the and part. How can I go about getting around this or writing the formula with a new word or character that excel will accept? Thanks, jason |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
If statment
=IF(AND(A1=36526,A1<37257),TRUE,FALSE)
Vaya con Dios, Chuck, CABGx3 "Jason" wrote in message ... I am trying to write and if statment to include only 2001 dates. However, I have dates both in 2000 and 2002. I tried the writing the following statment and excel keeps giving me an error: =IF(Date Field=1/1/2000 AND <1/1/2002, TRUE, FALSE) Apparently excel doesn't like the and part. How can I go about getting around this or writing the formula with a new word or character that excel will accept? Thanks, jason |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
if statment | Excel Worksheet Functions | |||
If statment if its possible. | Excel Discussion (Misc queries) | |||
Something is wrong with this IF statment | Excel Worksheet Functions | |||
How do I use 'And' or "Or" in an If statment | Excel Worksheet Functions | |||
If statment | Excel Worksheet Functions |