Nested If Statement Maximum Reached

M

Mike

It seems I have reached the maximum number of if
statements that Excel allows. I'm testing up against a
cell that has a pull down menu with values of each month
of the year in it. Jan, Feb, Mar...

I want to test the cell value (Month Abbrev.) in one cell
and print the full month in another cell. The following
condition works to August but when I add Sept it bombs. I
guess I've reached a point where Excel does not allow a
certain number of nested if's.

Does anyone have any ideas to work around this? I would
like to run through each of the Months (12 times)

This Statement works but It only works through August.

=IF(B35="Jan","January",IF(B35="Feb","February",IF
(B35="Mar","March",IF(B35="Apr","April",IF
(B35="May","May",IF(B35="Jun","June",IF
(B35="Jul","July",IF(B35="Aug","August",""))))))))

Thank you for your help,
Mike Cook
 
B

Bob Phillips

=VLOOKUP(B35,{"Jan","January";"Feb","February";"Mar","March";"Apr","April";"
May","May";"Jun","June";"Jul","July";"Aug","August";"Sep","September";"Oct",
"October";"Nov","November";"Dec","December"},2,FALSE)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
B

Bob Phillips

=VLOOKUP(B35,{"Jan","January";"Feb","February";"Mar","March";"Apr","April";"
May","May";"Jun","June";"Jul","July";"Aug","August";"Sep","September";"Oct",
"October";"Nov","November";"Dec","December"},2,FALSE)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
G

Guest

Thanks Bob, I'll give it a try.

Mike
-----Original Message-----
=VLOOKUP(B35, {"Jan","January";"Feb","February";"Mar","March";"Apr","Apr
il";"
,"September";"Oct",
"October";"Nov","November";"Dec","December"},2,FALSE)

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)




.
 
F

Frank Kabel

Hi
another way (maybe not as robust as Bob's solution):
=TEXT(DATEVALUE("1-" & B35 & "-2004"),"MMMM")
 
F

Frank Kabel

Harlan said:
...
..

Wasteful.

=TEXT("1-"&B35,"MMMM")

Harlan
nice one. TEXT seems to be quite robust in respect to processing
partial date values.
And yes in this case my approach is wasteful :)

Frank
 

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