selection based on a date in a cell

M

mattguerilla

Hi,

I want to put specific data into a cell, based on the date in another cell.
i.e. if the date is between two specific dates, populate the other cell with
"A", if between two other dates then "B" etc. I want to fill in a table of
the dates (which are financial periods 1 to 12), so if the date is in period
1, "P 01" is populated to a specific cell. Is this possible?

hope someone can help,
kind regards,

Matt
 
J

Jaytee

Try this:
Target 1 Target 2 Input Date Answer
A B C D
1 01/01/06 01/31/06 01/25/06 =if(C1>A1,if(C1<b1,"A","B"),"B")

....where A is your answer if it IS between the Target Dates, and B is the
answer if it isn't. For added sophistication, try this in D1:

=if(C1="","",if(C1>A1,if(C1<b1,"A","B"),"B")

This gets rid of the annoying error message if C1 is blank.
 
D

Don Guillett

One way, among many, would be to just use an if starting with the highest
date
=if(date>highest,1,if(date>nexthighest,2,etc))
 
Top