A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

putting a date in an if statement



 
 
Thread Tools Display Modes
  #1  
Old May 21st, 2010, 06:48 PM posted to microsoft.public.excel.worksheet.functions
pat67
external usenet poster
 
Posts: 137
Default putting a date in an if statement

When i write an if statement taht says this =IF(J26/1/2010,"N/A",J2),
it always comes up false. How do make it see the date?
  #2  
Old May 21st, 2010, 07:04 PM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default putting a date in an if statement

=IF(J26/1/2010,"N/A",J2)

Excel evaluates that as: IF J2 is less than 6 divided by 1 divided by 2010.

The best way to do this is to use a cell to hold the date:

A1 = 6/1/2010

Then just refer to that cell:

=IF(J2A1,"N/A",J2)

Or, use the DATE function:

=IF(J2DATE(2010,6,1),"N/A",J2)

--
Biff
Microsoft Excel MVP


"pat67" wrote in message
...
When i write an if statement taht says this =IF(J26/1/2010,"N/A",J2),
it always comes up false. How do make it see the date?



  #3  
Old May 21st, 2010, 08:28 PM posted to microsoft.public.excel.worksheet.functions
pat67
external usenet poster
 
Posts: 137
Default putting a date in an if statement

On May 21, 2:04*pm, "T. Valko" wrote:
=IF(J26/1/2010,"N/A",J2)


Excel evaluates that as: IF J2 is less than 6 divided by 1 divided by 2010.

  #4  
Old May 21st, 2010, 08:33 PM posted to microsoft.public.excel.worksheet.functions
jayray
external usenet poster
 
Posts: 10
Default putting a date in an if statement

On May 21, 2:04*pm, "T. Valko" wrote:
=IF(J26/1/2010,"N/A",J2)


Excel evaluates that as: IF J2 is less than 6 divided by 1 divided by 2010.

  #5  
Old May 21st, 2010, 10:26 PM posted to microsoft.public.excel.worksheet.functions
Chip Pearson
external usenet poster
 
Posts: 1,343
Default putting a date in an if statement

Or you can put it as =IF(J2DATEVALUE("6/1/2010"),"N/A",J2)

I would be careful with that due to international settings. In the US,
"6/1/2010" means 1-June-2010, but in Europe it means 6-January-2010. I
would recommend that you use the DATE function to unambiguously get a
date. E.g., DATE(2010,6,1)

Cordially,
Chip Pearson
Microsoft Most Valuable Professional,
Excel, 1998 - 2010
Pearson Software Consulting, LLC
www.cpearson.com




On Fri, 21 May 2010 12:33:34 -0700 (PDT), jayray
wrote:

On May 21, 2:04*pm, "T. Valko" wrote:
=IF(J26/1/2010,"N/A",J2)


Excel evaluates that as: IF J2 is less than 6 divided by 1 divided by 2010.

The best way to do this is to use a cell to hold the date:

A1 = 6/1/2010

Then just refer to that cell:

=IF(J2A1,"N/A",J2)

Or, use the DATE function:

=IF(J2DATE(2010,6,1),"N/A",J2)

--
Biff
Microsoft Excel MVP

"pat67" wrote in message

...



When i write an if statement taht says this =IF(J26/1/2010,"N/A",J2),
it always comes up false. How do make it see the date?- Hide quoted text -


- Show quoted text -


Or you can put it as =IF(J2DATEVALUE("6/1/2010"),"N/A",J2)

  #6  
Old May 22nd, 2010, 02:25 AM posted to microsoft.public.excel.worksheet.functions
T. Valko
external usenet poster
 
Posts: 15,759
Default putting a date in an if statement

You're welcome!

--
Biff
Microsoft Excel MVP


"pat67" wrote in message
...
On May 21, 2:04 pm, "T. Valko" wrote:
=IF(J26/1/2010,"N/A",J2)


Excel evaluates that as: IF J2 is less than 6 divided by 1 divided by
2010.

The best way to do this is to use a cell to hold the date:

A1 = 6/1/2010

Then just refer to that cell:

=IF(J2A1,"N/A",J2)

Or, use the DATE function:

=IF(J2DATE(2010,6,1),"N/A",J2)

--
Biff
Microsoft Excel MVP

"pat67" wrote in message

...



When i write an if statement taht says this =IF(J26/1/2010,"N/A",J2),
it always comes up false. How do make it see the date?- Hide quoted
text -


- Show quoted text -


thanks


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:03 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.