How to add more than 7 if nested statements. 7 is the limit.

G

Guest

I am trying to show 12 month names from dates, but can show only 8 since if
statments can be nested 7 times.
Eg of my data and formula:
=IF(MONTH(D2)=10,"Oct04",IF(MONTH(D2)=11,"Nov04",IF(MONTH(D2)=1,"Jan05",IF(MONTH(D2)=2,"Feb05",IF(MONTH(D2)=3,"Mar05",IF(MONTH(D2)=12,"Dec04",IF(MONTH(D2)=4,"Apr05")))))))
I need to join the if statment to show the rest of the months.
Thanks.
RRS.
 
N

Niek Otten

=TEXT(A1,"mmm")&"04"

but probably this suits you better:

=TEXT(A1,"mmm")&TEXT(A1,"yy")

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
 
G

Guest

Hi,

One possibility:
Create a helper list in two columns (say X1:X12, Y1:Y12) and populate them
with numbers and month/year-info (1 in X1 and Jan-05 in Y1,......10 in X10
and Oct-04 in Y10,...12 in X12 and Dec-04 in Y12). Now use the formula in,
say E2,

=VLOOKUP(MONTH(D2),$X$1:$Y$12,2)

Regards,
B. R. Ramachandran
 
R

Roger Govier

Just to add another variation to the answers already received from Bernie
and Niek, you could just format cell D2 (and the rest of the column if
required) as

Format Cells>Number>Custom mmmyy

Regards

Roger Govier
 
R

Roger Govier

Thanks Niek

If only I could think that way always!!!
I usually use the sledgehammer.

Regards

Roger Govier
 
R

Ron Rosenfeld

On Fri, 23 Sep 2005 08:00:02 -0700, "RRS from Connecticut" <RRS from
I am trying to show 12 month names from dates, but can show only 8 since if
statments can be nested 7 times.
Eg of my data and formula:
=IF(MONTH(D2)=10,"Oct04",IF(MONTH(D2)=11,"Nov04",IF(MONTH(D2)=1,"Jan05",IF(MONTH(D2)=2,"Feb05",IF(MONTH(D2)=3,"Mar05",IF(MONTH(D2)=12,"Dec04",IF(MONTH(D2)=4,"Apr05")))))))
I need to join the if statment to show the rest of the months.
Thanks.
RRS.

Since we are giving you all sorts of solutions, I thought I'd throw out
another:

=CHOOSE(MONTH(D2),"Jan05","Feb05","Mar05","Apr05",...,etc)


--ron
 

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