ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Comparing dates in an IF function (https://www.excelbanter.com/excel-worksheet-functions/9087-comparing-dates-if-function.html)

Paula

Comparing dates in an IF function
 
Could someone kindly give me some guidance on the below:

I have two columns, one a list of dates, and the other which is supposed to
show a 'Y' if the date in the same row is prior to a certain date e.g. 3rd
January 2005, and an 'N' if not.

My formula looks like this, but doesn't seem to work:

=IF(G2<03/01/2005,"Y","N") Any thoughts? TIA

Arvi Laanemets

Hi

=IF(G2<DATE(2005,1,3),"Y","N")

--
When sending mail, use address arvil<attarkon.ee
Arvi Laanemets


"Paula" wrote in message
...
Could someone kindly give me some guidance on the below:

I have two columns, one a list of dates, and the other which is supposed

to
show a 'Y' if the date in the same row is prior to a certain date e.g. 3rd
January 2005, and an 'N' if not.

My formula looks like this, but doesn't seem to work:

=IF(G2<03/01/2005,"Y","N") Any thoughts? TIA




RagDyeR

It's usually easier to designate a cell to hold the date you're looking for,
so that it can be changed much more simply for future calculations.

Also, using true XL dates, you don't have to worry about matching formats
between the formula and the data.

Try this:

=IF(G2<A1,"Y","N")

With the date you're looking for entered in A1.
--

HTH,

RD
==============================================
Please keep all correspondence within the Group, so all may benefit!
==============================================


"Paula" wrote in message
...
Could someone kindly give me some guidance on the below:

I have two columns, one a list of dates, and the other which is supposed to
show a 'Y' if the date in the same row is prior to a certain date e.g. 3rd
January 2005, and an 'N' if not.

My formula looks like this, but doesn't seem to work:

=IF(G2<03/01/2005,"Y","N") Any thoughts? TIA



David Jessop

Hi,

The problem is that Excel is helpfully converting 03/01/2005 to a number
(probably 3/2005). If you try

=IF(G2<datevalue("03/01/2005"),"Y","N")

if should work.

David Jessop

"Paula" wrote:

Could someone kindly give me some guidance on the below:

I have two columns, one a list of dates, and the other which is supposed to
show a 'Y' if the date in the same row is prior to a certain date e.g. 3rd
January 2005, and an 'N' if not.

My formula looks like this, but doesn't seem to work:

=IF(G2<03/01/2005,"Y","N") Any thoughts? TIA



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

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