#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default Month(A1) in 2007

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
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,856
Default Month(A1) in 2007

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

On Sep 8, 12:54*pm, rexmann wrote:
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


  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,520
Default Month(A1) in 2007

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
---------------
Jacob Skaria


"rexmann" wrote:

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

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default Month(A1) in 2007

Use text function

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


"rexmann" wrote:

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

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Month(A1) in 2007

=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")

rexmann wrote:

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


--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 79
Default Month(A1) in 2007

Thank you all, works perfect

Cheers Rexmann

"Dave Peterson" wrote:

=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")

rexmann wrote:

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
End of Month tic marks in Excel 2007 krkatak Charts and Charting in Excel 1 January 19th 09 07:59 PM
excel to make the days cary over month to month automaticly GARY New Users to Excel 1 April 19th 08 06:05 PM
Excel 2003 month to month data change grid Chad[_2_] Excel Discussion (Misc queries) 2 February 15th 08 01:36 AM
Converting Month Number to Month Text Abbreviation Bob Excel Worksheet Functions 10 May 12th 07 04:11 AM
transfer cell $ amount to other sheet month-to-month without overc Colin2u Excel Discussion (Misc queries) 1 July 28th 05 02:36 AM


All times are GMT +1. The time now is 04:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"