Archive of Mr Excel Message Board
Back to Dates in Excel archive index
Back to archive home
Using a date in a IF-statementPosted by Michael on September 19, 2001 12:02 AM
If cell A1="08:00:00", the formula :
returns 0 !!!
So, what am I doing wrong ?
I've tried with different (time)formats in A1, but nothings helps.
Re: Using a date in a IF-statementPosted by Richard S on September 19, 2001 12:20 AM
I'm pretty sure that by putting "05:00:00" in your formula, Excel isn't recognising it as a time, but as text. If you put "05:00:00" in cell B1 and change your formula to
it will return 1.
Re: Using a date in a IF-statementPosted by Michael on September 19, 2001 12:31 AM
You're absolutely right Richard,
it works if I'm using a cell in my formula !
Re: Using a date in a IF-statementPosted by Aladin Akyurek on September 19, 2001 1:02 AM
However, you might occasionally need to use a constant like 05:00:00 directly in the formula. In that case, to overcome the trouble Richard pointed out, you'd use e.g.,
This archive is from the original message board at www.MrExcel.com.
All contents © 1998-2004 MrExcel.com.
Visit our online store
to buy searchable CD's with thousands of VBA and Excel answers.
Microsoft Excel is a registered trademark of the Microsoft Corporation.
MrExcel is a registered trademark of Tickling Keys, Inc.