Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
if statements & dates?
Is there a problem with using dates in IF statements? I'm trying to ask
Excel to record 0 if the date is 9/9/99, and if it's not 9/9/99 put in the content of the cell: =if(a1=9/9/99,0,a1) It works for dates unless it's 9/9/99 Thanks Lynn |
#2
|
|||
|
|||
On Mon, 19 Sep 2005 07:38:04 -0700, "Lynn"
wrote: Is there a problem with using dates in IF statements? I'm trying to ask Excel to record 0 if the date is 9/9/99, and if it's not 9/9/99 put in the content of the cell: =if(a1=9/9/99,0,a1) It works for dates unless it's 9/9/99 Not really, with the syntax you've shown. When you omit the quotes in the IF statement, Excel will interpret the value as requiring multiple divisions. So use: =if(a1="9/9/99",0,a1) Better (as it will be less ambiguous): =if(a1=date(99,9,9),0,a1) Probably best, as it allows easy modification: =if(a1=b1,0,a1) With the date to be compared with in B1. --ron |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 digit year in dates return 19xx not 20xx | Excel Discussion (Misc queries) | |||
Default Dates | Excel Discussion (Misc queries) | |||
Using dates for x-axis values as string instead of creating a scale | Charts and Charting in Excel | |||
Formating Dates for production schedule | Excel Discussion (Misc queries) | |||
due dates | New Users to Excel |