Extract Month Name from Cell

brncao

Board Regular
Joined
Apr 28, 2015
Messages
147
Hey guys. I was wondering if there's a way to extract the name of the month from a cell. I'd like to figure out the two formulas, one with just the month name, and the other with the month and year.

For example,
Input: "Payment received as of January 31, 2020"
Output: Jan/January
Output: Jan/January 2020

Thanks
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
To return the Month name:

=IFERROR(TEXT(--MID(A2,AGGREGATE(14,6,SEARCH(TEXT(ROW($1:$12)*29,"mmmm"),A2),1),255),"mmmm"),"Invalid Date")

This will return "January"


To return the Month Name and Year:

=IFERROR(TEXT(--MID(A2,AGGREGATE(14,6,SEARCH(TEXT(ROW($1:$12)*29,"mmmm"),A2),1),255),"mmmm yyyy"),"Invalid Date")

This will return "January 2020"


And if there is no valid date then the formula will return ""Invalid Date".

To include search for abbreviated names of "Jan", "Feb" etc. you may use "mmm" instead of "mmmm" within the SEARCH function.
 
Upvote 0

Forum statistics

Threads
1,215,330
Messages
6,124,308
Members
449,152
Latest member
PressEscape

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