ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Dates in Excel (https://www.excelbanter.com/excel-worksheet-functions/37047-dates-excel.html)

Karen Saberi

Dates in Excel
 
I want to use the "IF" function to allocate students to groups based on their
date of birth. I have tried doing this using the format

IF(D2<1/9/1994,"Secondary","Primary")

D2 is the cell with the first student's date of birth. I can't get the
result I want, as all students come out as "primary" regardless of their date
of birth, and even the first student was born in 1989.

Can anybody help?

Bob Phillips

=IF(D2<--"1994-09-01","Secondary","Primary")

--
HTH

Bob Phillips

"Karen Saberi" <Karen wrote in message
...
I want to use the "IF" function to allocate students to groups based on

their
date of birth. I have tried doing this using the format

IF(D2<1/9/1994,"Secondary","Primary")

D2 is the cell with the first student's date of birth. I can't get the
result I want, as all students come out as "primary" regardless of their

date
of birth, and even the first student was born in 1989.

Can anybody help?




Arvi Laanemets

Hi

Try
=IF(D2<DATE(1994,9,1),"Secondary","Primary")

When this doesn't work, check values in column D - are they really dates?
Change cell format in column to numeric - when entries don't change to
numbers, then they are datestrings instead of dates.


Arvi Laanemets


"Karen Saberi" <Karen wrote in message
...
I want to use the "IF" function to allocate students to groups based on

their
date of birth. I have tried doing this using the format

IF(D2<1/9/1994,"Secondary","Primary")

D2 is the cell with the first student's date of birth. I can't get the
result I want, as all students come out as "primary" regardless of their

date
of birth, and even the first student was born in 1989.

Can anybody help?




Mayank Prakash Gupta

it seems correct to me....i tried it out myself and it works....somebody
please share your thoughts.


"Karen Saberi" <Karen wrote in message
...
I want to use the "IF" function to allocate students to groups based on
their
date of birth. I have tried doing this using the format

IF(D2<1/9/1994,"Secondary","Primary")

D2 is the cell with the first student's date of birth. I can't get the
result I want, as all students come out as "primary" regardless of their
date
of birth, and even the first student was born in 1989.

Can anybody help?




Karen Saberi

Thanks Bob. Problem solved.

"Bob Phillips" wrote:

=IF(D2<--"1994-09-01","Secondary","Primary")

--
HTH

Bob Phillips

"Karen Saberi" <Karen wrote in message
...
I want to use the "IF" function to allocate students to groups based on

their
date of birth. I have tried doing this using the format

IF(D2<1/9/1994,"Secondary","Primary")

D2 is the cell with the first student's date of birth. I can't get the
result I want, as all students come out as "primary" regardless of their

date
of birth, and even the first student was born in 1989.

Can anybody help?






All times are GMT +1. The time now is 07:53 AM.

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