Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Eric
 
Posts: n/a
Default How to add date format into if statement?

Does anyone know how to add date format into if statement? such as
If(A1="1-Mar-2005", 1,0)
Thank you
Eric
  #2   Report Post  
Eric
 
Posts: n/a
Default How to add date format into if statement?

I want to determine whether the day and month only are within certain period?
such as
If "10-Mar-2005" is between "1-Mar" and "14-May" and ignore the year, then
return 1, else return 0.
Reture value should be 1 in this case.
Thank you
Eric
  #3   Report Post  
JE McGimpsey
 
Posts: n/a
Default How to add date format into if statement?

One way:

=IF(A1=DATE(2005,3,1),1,0)

or, more efficiently

=--(A1=DATE(2005,3,1)

since XL treats boolean operators (TRUE/FALSE) as 1/0 in math operations
(negation, then negation again).

In article ,
"Eric" wrote:

Does anyone know how to add date format into if statement? such as
If(A1="1-Mar-2005", 1,0)
Thank you
Eric

  #4   Report Post  
Bob Phillips
 
Posts: n/a
Default How to add date format into if statement?

See response in worksheet.functions

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Eric" wrote in message
...
Does anyone know how to add date format into if statement? such as
If(A1="1-Mar-2005", 1,0)
Thank you
Eric



  #5   Report Post  
Eric
 
Posts: n/a
Default How to add date format into if statement?

Thank everyone very much
Eric
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
Why Does Date Format Change on Chart John Taylor Excel Discussion (Misc queries) 0 September 11th 05 08:16 AM
Compare dates (one cell not in date format) craigcsb Excel Discussion (Misc queries) 5 June 28th 05 05:07 PM
Date Format Inside of a SUMIF Statement Minitman Excel Worksheet Functions 9 June 13th 05 07:52 PM
How do I keep the date from changing format in a mail merge? Brynn Wilson Excel Discussion (Misc queries) 1 June 9th 05 06:44 PM
USING THE DATE FORMAT IN EXCEL teach Excel Discussion (Misc queries) 3 December 14th 04 11:55 PM


All times are GMT +1. The time now is 11:47 AM.

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

About Us

"It's about Microsoft Excel"