ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel & dates... how to determine order. (https://www.excelbanter.com/excel-programming/291235-excel-dates-how-determine-order.html)

antoinejon

Excel & dates... how to determine order.
 
Hi everyone:

I have a huge formula to figure out changing interest rates per year.
was wondering if anyone new of a function that did something lik
this:

A1 Cell is greater than (or is more recent than) 1-1-1992

I am using this for an if/then function, so if the date came before 9
then ####, if not, then it's zero. I already have that part of th
formula figured out, just so you know what I'm dealing with.

Please post any ideas, or if you have any questions.

Thank you!
antoin

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Excel & dates... how to determine order.
 
I think most would have trouble figuring out what you are actually asking
here.

--
Regards,
Tom Ogilvy


antoinejon wrote in message
...
Hi everyone:

I have a huge formula to figure out changing interest rates per year. I
was wondering if anyone new of a function that did something like
this:

A1 Cell is greater than (or is more recent than) 1-1-1992

I am using this for an if/then function, so if the date came before 92
then ####, if not, then it's zero. I already have that part of the
formula figured out, just so you know what I'm dealing with.

Please post any ideas, or if you have any questions.

Thank you!
antoine


---
Message posted from http://www.ExcelForum.com/




BrianB

Excel & dates... how to determine order.
 
If you have formatted your columns as dates then the contents are jus
numbers (try one cell - Copy/Edit Paste Special Values).

You therefore use them the same as any other number
eg. IF(A1<B1,1,0)
To use a hard coded date in the comparison formula it needs to be se
to a number :-
eg. =IF(A1DATEVALUE("1/1/92"),"After","Before")
=IF(YEAR(A1)<1992,"Before","After")

This is duplicated in code by If ....Then ... Else ..

Beware. VBA changes hard coded dates to the American format "mm/dd/yy"
especially if you use
MyDate=#31/1/92#
("it's a feature, not a bug" <grin)
so you may need to ensure that you use something like .....
MyDate=Format("1/1/92","dd/mm/yy"

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 07:19 PM.

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