single digit to text Month

Trouttrap2

Well-known Member
Joined
May 11, 2010
Messages
612
I know that =month(1&"March") gives me 3, the third month. Can anybody explain why?
Also, how would I take the number 3, for example, and return "March" using a formula? Basically the reverse of my first question. Is this the best there is? =TEXT(C17*29,"mmmm")

Thanks
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
I know that =month(1&"March") gives me 3, the third month. Can anybody explain why?
Also, how would I take the number 3, for example, and return "March" using a formula? Basically the reverse of my first question. Is this the best there is? =TEXT(C17*29,"mmmm")

Thanks

To start out answering the first question, =MONTH(date) is a formula that will look at the date inside the function, and return its month (January = 1, February = 2, and so on). However, it must have date stored as a date inside of it (ie, it cannot use a string "January", "February", etc).

So to allow it to use the string, we use 1&"January", 1&"February", etc. By using 1&*monthname*, we coerce the value into a valid date. To further illustrate, go to a cell and type January. Then go to the next cell and type 1January. The cell you typed 1January should change automatically to 1-Jan. If you format the cell in a mm/dd/yyyy format, it will read 01/01/2011. Since this is a valid date, the MONTH function can handle it.

For your second question, that is a viable option. Another way would be to use:

=TEXT(DATE(1900,C17,1),"mmmm")
 
Upvote 0

Forum statistics

Threads
1,224,524
Messages
6,179,310
Members
452,906
Latest member
phanmemchatdakenhupviral

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