View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default extracting only month from a date

2 I get stucked whenever there is more than
eight IF in the neseted IF


2. It is more than 7 and not 8.


Then why does this work?

=IF(A1=1,1,IF(A1=2,2,IF(A1=3,3,IF(A1=4,4,IF(A1=5,5 ,IF(A1=6,6,IF(A1=7,7,IF(A1=8,8,"none"))))))))

There are 8 IF calls.

The first IF *is not a nested level*. Each subsequent IF is a nested level
for a total of 7 nested levels.

You can use concatenation for *many* IFs but there is usually a better way:

=IF(A1=1,1,"")&IF(A1=2,2,"")&IF(A1=3,3,"")&IF(A1=4 ,4,"")&IF(A1=5,5,"")&IF(A1=6,6,"")&IF(A1=7,7,"")&I F(A1=8,8,"")&IF(A1=9,9,"")&IF(A1=10,10,"")&IF(A1=1 1,11,"")&IF(A1=12,12,"")&IF(A1=13,13,"")&IF(A1=14, 14,"")&IF(A1=15,15,"")

Using this technique you're only limited to the max allowable length of a
formula.

--
Biff
Microsoft Excel MVP


"Jacob Skaria" wrote in message
...
1. To maintain in excel date format format the date field to MMM
(FormatCellsCustomType mmm)

OR use the below formula which will be in text format

=IF(A1,UPPER(TEXT(A1,"mmm")),"")

2. It is more than 7 and not 8. Post your scenario and there should be
some
other way to acheive what you want

If this post helps click Yes
---------------
Jacob Skaria


"deepak" wrote:

Hello!

1 Suppose A1 has date in format dd-mm-yy , say 12-DEC-09. How can I have
extract only DEC from A1?

2 I get stucked whenever there is more than eight IF in the neseted IF
statement. Cannot we have more than 8 IF?

Please help me out.

Thanking you.