Month(A1) in 2007

R

rexmann

Hi All

I am trying to get just the year and month of a date to display and I am using

=year(A1)
=month(A1)

the year is fine but the month appears as a number 1-12. I have tried
changing the field to custom month but this just give the wrong answer. I can
use a v-lookup to convert which is no problem but a bit messy (I remember in
2003 it worked fine)

Any suggestions greatly appreciated

cheers Rexmann
 
P

Pete_UK

Try this for month:

=TEXT(A1,"mmm")

if you just want the first 3 letters of the month, or:

=TEXT(A1,"mmmm")

if you want the full month name.

You can combine the month and year, like so:

=TEXT(A1,"mmm-yyyy")

to give you SEP-2009, for example.

Hope this helps.

Pete
 
J

Jacob Skaria

Custom format (mmm) will work only if the cell contains actual date.

Try the below with date in cell A1 which returns a text value
=TEXT(A1,"mmm")

If this post helps click Yes
 
J

Joel

Use text function

For abbreviate months
=Text(month(A1),"mmm")
or
For non-abbreviated months
=Text(month(A1),"mmmm")
 
D

Dave Peterson

=month() returns the number of the month.

If you want text, you could use:
=text(a1,"mmm")
or
=text(a1,"mmmm")

Or you could combine both the year and month and use something like:
=text(a1,"yyyy-mmm")
 
R

rexmann

Thank you all, works perfect

Cheers Rexmann

Dave Peterson said:
=month() returns the number of the month.

If you want text, you could use:
=text(a1,"mmm")
or
=text(a1,"mmmm")

Or you could combine both the year and month and use something like:
=text(a1,"yyyy-mmm")
 

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

Similar Threads


Top