Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have a problem with if statement using date data. today() = 8/5/2005 I put a formula =if(today()=8/5/2005,true,false) it's displaying a false answer when it should be displaying true Hope somebody help me with this. thanks! -- japorms ------------------------------------------------------------------------ japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544 View this thread: http://www.excelforum.com/showthread...hreadid=393200 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi JA,
I thimk that, in the formula, Excel treats 8/5/2005 as a double division of integer values. If you try entering 8/5/2005 in another cell and use that cell reference in the formula in place of the date string, you should get the result you expect. This is because Excel then recognises the cell entry as a date. alternatively, the following worked for me: =IF(TODAY()=DATE(2005,8,5),TRUE,FALSE) or =IF(TODAY()=DATEVALUE("8/5/05"),TRUE,FALSE) --- Regards, Norman "japorms" wrote in message ... I have a problem with if statement using date data. today() = 8/5/2005 I put a formula =if(today()=8/5/2005,true,false) it's displaying a false answer when it should be displaying true Hope somebody help me with this. thanks! -- japorms ------------------------------------------------------------------------ japorms's Profile: http://www.excelforum.com/member.php...fo&userid=6544 View this thread: http://www.excelforum.com/showthread...hreadid=393200 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi japorms,
I put a formula =if(today()=8/5/2005,true,false) What your formula does in reality is to compare today's date with reresult of two operations: 8 divided by 5 divided by 2005 :-) Apart from that the use of the IF function in your fomula is wasteful as an equation already retutns TRUE or FALSE by default. You could use the following formulas: =TODAY()=--"8/5/2005" =TODAY()=DATE(2005,8,5) =TODAY()=VALUE("8/5/2005") =TODAY()=DATEVALUE("8/5/2005") =TEXT(TODAY(),"m/d/yyyy")="8/5/2005" Regards, KL |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
even easier and more flexible?
A1 type = today(),A2 type 5/8/2005(or whatever),A3 type A1=A2,result = true or false. -- paul remove nospam for email addy! "KL" wrote: Hi japorms, I put a formula =if(today()=8/5/2005,true,false) What your formula does in reality is to compare today's date with reresult of two operations: 8 divided by 5 divided by 2005 :-) Apart from that the use of the IF function in your fomula is wasteful as an equation already retutns TRUE or FALSE by default. You could use the following formulas: =TODAY()=--"8/5/2005" =TODAY()=DATE(2005,8,5) =TODAY()=VALUE("8/5/2005") =TODAY()=DATEVALUE("8/5/2005") =TEXT(TODAY(),"m/d/yyyy")="8/5/2005" Regards, KL |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "KL" wrote in message ... =TODAY()=--"8/5/2005" Better to use ISO standard --"2005-08-05", no confusion then as to whether it is 5th Aug or 8th May. |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Use: =IF(TODAY()=DATEVALUE("8/5/2005"),TRUE,FALSE) Mangesh -- mangesh_yadav ------------------------------------------------------------------------ mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470 View this thread: http://www.excelforum.com/showthread...hreadid=393200 |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Fri, 5 Aug 2005 01:25:34 -0500, mangesh_yadav
wrote: Use: =IF(TODAY()=DATEVALUE("8/5/2005"),TRUE,FALSE) Mangesh Unless of course you're working with UK (& European?) style dates, where the 5th August is generally shown as 5/8/2005. Anyone know a general solution which would presumably use the system locale somewhere in the formula, or is this only possible using VBA code? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Richard,
The general (and always safest) is to use: =Date(2005,8,5) (thats 5th Aug 2005) Mangesh "Richard Buttrey" wrote in message ... On Fri, 5 Aug 2005 01:25:34 -0500, mangesh_yadav wrote: Use: =IF(TODAY()=DATEVALUE("8/5/2005"),TRUE,FALSE) Mangesh Unless of course you're working with UK (& European?) style dates, where the 5th August is generally shown as 5/8/2005. Anyone know a general solution which would presumably use the system locale somewhere in the formula, or is this only possible using VBA code? Rgds __ Richard Buttrey Grappenhall, Cheshire, UK __________________________ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
IF AND Statement Needed | Excel Worksheet Functions | |||
Help needed would this be an IF statement | Excel Worksheet Functions | |||
If statement ... help needed. | Excel Worksheet Functions | |||
Another IF statement needed | Excel Worksheet Functions | |||
IF STATEMENT HELP NEEDED!!! | Excel Discussion (Misc queries) |