# An Excel 2007 Question

on
Hi everyone,

I have an Excel 2007 Spreadsheet that has a drop down list with months OCT through Sept.  The drop down list is in Cell O7.  If OCT  through DEC is selected, I want the Year
"2010" to be put in P7 right beside it.  If Jan through Sep is selected I want the Year "2011" placed in P7 right beside it.   How can this be done in simple coding or with an If Function or some other way.  I thought about DLOOKUP but I just can't get it to work.  I could List all of the Years in another sheet for Column A and the Month Name in Column B and do this some way.  But, I want the most simplest way to do it.  If it can be done logically with an IF.  I might like this better.  I do not know.
Comment
Watch Question

Do more with

EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Sr. Project Manager
Commented:
This can be done with a simple IF condition like this -

=IF(MONTH("01/"&O7)<=9,2011,2010)

See attached file

thanks,
Ardhendu
Sr. Project Manager

Commented:
File attached...
EE-ID-27238421.xlsx

Commented:
This in P7?

=if(or(o7="oct",o7="nov",o7="dec"),"2010,"2011")

Commented:
check this
Book1.xls
Finance Analyst

Commented:
Can you not put the full month and date in the dropdown?

One slightly different way around it, Oct Nov & Dec are the only months with the initial letters O N & D, so:

=IF(OR(LEFT(O7,1)="O",LEFT(O7,1)="N",LEFT(O7,1)="D"),2010,2011)

Thanks
Rob H

Commented:
Excellent!

Do more with