Convert month number to string

G

Graham

I have a master sheet in which date is stored in columns by month. Row 1 has
the year and row 2 has the month number (1 to 12).

There are presentation sheets that reference subsets of the master data and
on those sheets I would like to display a 3 char string for the month e.g.
'JAN' for month 1.

Any suggestions, please?
 
R

Ron Rosenfeld

I have a master sheet in which date is stored in columns by month. Row 1 has
the year and row 2 has the month number (1 to 12).

There are presentation sheets that reference subsets of the master data and
on those sheets I would like to display a 3 char string for the month e.g.
'JAN' for month 1.

Any suggestions, please?


=TEXT(DATE(2006,A2,1),"mmm")

(The year and day of the month are irrelevant for this purpose).


--ron
 
G

Graham

Thanks Ron

So simple when you have the knowledge, or can figue out what to search for.

Thanks again.
 
R

Roger Govier

=TEXT(A1&"-1","mmm")
Neat solution!! but I think you meant to reference cell A2 not A1.

Also, dependant upon your regional settings, (in the UK for example) you
would need to use
=TEXT("1-"&A2,"mmm")
 
R

Ron Rosenfeld

Neat solution!! but I think you meant to reference cell A2 not A1.

Also, dependant upon your regional settings, (in the UK for example) you
would need to use
=TEXT("1-"&A2,"mmm")

That's an advantage of using the DATE worksheet function -- it is not locale
dependent.


--ron
 
Top