Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default putting a date in an if statement

When i write an if statement taht says this =IF(J2<6/1/2010,"N/A",J2),
it always comes up false. How do make it see the date?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default putting a date in an if statement

=IF(J2<6/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(J2<A1,"N/A",J2)

Or, use the DATE function:

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

--
Biff
Microsoft Excel MVP


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



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 48
Default putting a date in an if statement

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


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

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
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(J2<6/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(J2<A1,"N/A",J2)

Or, use the DATE function:

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

--
Biff
Microsoft Excel MVP

"pat67" wrote in message

...



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


- Show quoted text -


thanks


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 45
Default putting a date in an if statement

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


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



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 7,247
Default putting a date in an if statement

Or you can put it as =IF(J2<DATEVALUE("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(J2<6/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(J2<A1,"N/A",J2)

Or, use the DATE function:

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

--
Biff
Microsoft Excel MVP

"pat67" wrote in message

...



When i write an if statement taht says this =IF(J2<6/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(J2<DATEVALUE("6/1/2010"),"N/A",J2)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HOW DO YOU FORMAT A DATE? I KEEP PUTTING ONE IN AND IT CHANGES LADYBIRDDI Excel Worksheet Functions 2 May 21st 10 08:36 PM
putting in date ranges ZIPPOMA NEEDS HELP Excel Discussion (Misc queries) 1 October 14th 08 07:54 AM
I need a formula that change all date by putting in one date [email protected] Excel Worksheet Functions 2 August 7th 06 04:22 PM
putting date on spreadsheet Nikki Q Excel Discussion (Misc queries) 5 August 3rd 06 08:57 PM
Putting the date as a sheet name matthewwookie Excel Discussion (Misc queries) 3 September 26th 05 04:36 PM


All times are GMT +1. The time now is 04:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"