Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text(month),"mmm")

Status
Not open for further replies.

Topcat04

Technical User
Sep 14, 2007
121
GB
Hi all

Does anybody have any help and advice, why the following formula always returns Jan as the month

=text(month(a2),"mmm")&char(13)&year(a2)
=text(month(b2),"mmm")&char(13)&year(b2)

a2 contains 01/01/07, formatted as January-07
b2 contains 02/02/07, formatted as February-07

this continues for the rest of the months, but I always get Jan 07 returned.

any ideas?
thanks
 
Take out the month() and just use the cell reference:

=text(a2,"mmm")&char(13)&year(a2)

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 
Also, you do not need the char(13), you can just do:

=text(a2,"mmm")&" "&year(a2)

[Blue]Blue[/Blue] [Dragon]

If I wasn't Blue, I would just be a Dragon...
 




FYI,

faq68-5827

Skip,

[glasses]Did you hear what happened when the OO programmer lost his library?...
He's now living in OBJECT poverty![tongue]
 
to fully answer

=MONTH(A2)

will never return anything greater than 12

=TEXT(12,"mmm")

will always return Jan as 12 in Date/Time parlance means
01/01/1900 as per the FAQ

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top