IF OR Formula

T

tsmith

In column "G" I have imported dates formatted as such...11/09/2009 9:58:00 AM

I'm in accounting so we go by fiscal month i.e. 10/24/09 thru 11/27/09 is
November

I'm looking for a formula that will tell me what month the date falls in.

I tried this...(not working
=IF(OR(G7>="09/26/2009","October",IF(G7<="10/23/09","October",IF(G7>="10/24/2009","November",IF(G7<="11/27/09","November",IF(G7>="11/28/09","December",IF(G7>="12/31/2009","December",FALSE)))))))

I'm not sure if I'm even on the right track.

Please help

Thank you,
T
 
P

Pete_UK

I assume you have proper dates. Your formula is comparing them with
text values, and you also have the logic wrong. Try this approach:

=IF(AND(G7>=--"09/26/2009",G7<=--"10/23/09"),"October",IF(AND
(G7>=--"10/24­/2009,G7<=--"11/27/09"),"November",IF(AND
(G7>=--"11/28/09",G7<=--"12/31/2009"),"December",FALSE)))

The double unary minus -- converts those text values to proper dates.
Also, you want the date to be later than the start date AND earlier
than the end date for each period.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top