extracting only month from a date

D

deepak

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.
 
J

Jacob Skaria

1. To maintain in excel date format format the date field to MMM
(Format>Cells>Custom>Type 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
 
P

Pritesh

You can go to Format Cells, from "Number" tab select "Custom", in "Type"
filed type mmm or mm (as you prefer) and press OK.
 
Y

YESHWANT

Hi Deepak,

1. as regards your first part of the post, u can use the following :
=TEXT(a1,"mmmm")

2. as regards your second part of the post, u can use something like
this
=IF(A1=1,1.3%,"")&IF(A1=2,3%,"")&IF(A1=4,6.5%,"")&IF(A1=5,2.2%,"")&IF(A1=6,4.4%,"")&IF(A1=9,7%,"")&IF(A1=10,7.5%,"")&IF(A1=11,8.8%,"")&IF(A1=3,3.5%,"")&IF(A1=12,4.9%,"")&IF(A1=13,1%,"")&IF(A1=7,1.6%,"")&IF(A1=8,6.25%,"")

click yes below, if it helps
 
T

T. Valko

2 I get stucked whenever there is more than
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,"")&IF(A1=8,8,"")&IF(A1=9,9,"")&IF(A1=10,10,"")&IF(A1=11,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.
 

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