ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   how do I use if formula using dates? (https://www.excelbanter.com/excel-worksheet-functions/54197-how-do-i-use-if-formula-using-dates.html)

Simone

how do I use if formula using dates?
 
I need use the if function to do the following:
if the hire date is greater than 9/30/2005, then the date should be
2/1/2006, otherwise the date should be 1/1/2006.

I have been using the following, if(A59/30/2005, 2/1/2006, 1/1/2006), but
it changes every date to 1/1/2006 including dates greater than 9/30/2005.

Please help!

Rowan Drummond

how do I use if formula using dates?
 
You could try:
=IF(A5DATEVALUE("09/30/2005"),DATEVALUE("2/1/2006"),DATEVALUE("1/1/2006"))
format result as Date

Hope this helps
Rowan

Simone wrote:
I need use the if function to do the following:
if the hire date is greater than 9/30/2005, then the date should be
2/1/2006, otherwise the date should be 1/1/2006.

I have been using the following, if(A59/30/2005, 2/1/2006, 1/1/2006), but
it changes every date to 1/1/2006 including dates greater than 9/30/2005.

Please help!


Bob Phillips

how do I use if formula using dates?
 
ANother way

=--"2006-01-01"+(A5--"2005-09-30")

--

HTH

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


"Simone" wrote in message
...
I need use the if function to do the following:
if the hire date is greater than 9/30/2005, then the date should be
2/1/2006, otherwise the date should be 1/1/2006.

I have been using the following, if(A59/30/2005, 2/1/2006, 1/1/2006), but
it changes every date to 1/1/2006 including dates greater than 9/30/2005.

Please help!




Dave Peterson

how do I use if formula using dates?
 
I like:

=if(a5date(2005,9,30),date(2006,2,1),date(2006,1, 1))

Then I don't have to worry about any settings on any pc.

But you were really checking to see if:
A5 was greater than 9 divided by 30 divided by 2005.

(9/30/2005 looks more like an arithmetic (division) than a date to excel.)



Simone wrote:

I need use the if function to do the following:
if the hire date is greater than 9/30/2005, then the date should be
2/1/2006, otherwise the date should be 1/1/2006.

I have been using the following, if(A59/30/2005, 2/1/2006, 1/1/2006), but
it changes every date to 1/1/2006 including dates greater than 9/30/2005.

Please help!


--

Dave Peterson

Dave Peterson

how do I use if formula using dates?
 
I think that that original expression was mdy, though. (well, if I can trust
that all were like 9/30/2005.)

Bob Phillips wrote:

ANother way

=--"2006-01-01"+(A5--"2005-09-30")

--

HTH

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

"Simone" wrote in message
...
I need use the if function to do the following:
if the hire date is greater than 9/30/2005, then the date should be
2/1/2006, otherwise the date should be 1/1/2006.

I have been using the following, if(A59/30/2005, 2/1/2006, 1/1/2006), but
it changes every date to 1/1/2006 including dates greater than 9/30/2005.

Please help!


--

Dave Peterson


All times are GMT +1. The time now is 01:34 PM.

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