ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   How to add date format into if statement? (https://www.excelbanter.com/excel-discussion-misc-queries/53923-how-add-date-format-into-if-statement.html)

Eric

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

Eric

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

JE McGimpsey

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


Bob Phillips

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




Eric

How to add date format into if statement?
 
Thank everyone very much
Eric


All times are GMT +1. The time now is 01:21 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com