Basic Text / Month Question

ekyles

Board Regular
Joined
Mar 7, 2008
Messages
50
Apologies for not challenging with a good VBA question, this is mighty basic.

Trying to convert a month number to three letters is returning "Jan" and not the correct month.

I have a date in Col A : 7/11/11
I have converted to month in Col B using =Text(Month(A1),"MMM")

Every month displays "Jan". Even typing in 7 without the date conversion and using the Text formula returns "Jan". Thanks.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Apologies for not challenging with a good VBA question, this is mighty basic.

Trying to convert a month number to three letters is returning "Jan" and not the correct month.

I have a date in Col A : 7/11/11
I have converted to month in Col B using =Text(Month(A1),"MMM")

Every month displays "Jan". Even typing in 7 without the date conversion and using the Text formula returns "Jan". Thanks.
Remove the MONTH function from your formula:

=TEXT(A1,"mmm")
 
Upvote 0
Just make the formula =text(A1,"MMM"). The reason it's doing Jan is because the MMM formatting of the date value 7 is 1/7/1900.
 
Upvote 0
Why does this not work?
Text(Month(A1),"MMM")


Because Excel stores dates as numbers..
1 = Jan 1 1900
2 = Jan 2 1900
etc..
40745 = July 21 2011

With me so far?

The MONTH function, returns the month NUMBER (1 -12)

So lets break it down
A1: 7/11/11
Text(Month(A1),"MMM")

Month(7/11/11) = 7 (or 11 in UK dates)

So formula becomes

=TEXT(7,"MMM")

7 = Jan 7th 1900

now formula is
=TEXT(1/7/1900,"MMM")
Formula results in January.


Hope that clears it up.
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,256
Members
452,901
Latest member
LisaGo

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top