extract month from Txt

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,572
Office Version
  1. 2021
Platform
  1. Windows
I have text data in col A


I need to extract the month in Col B


I have tried to set up a formula to do this but where the number of characters changes for a particular month, it does not work


It would be appreciated if someone could assist me




Book1
AB
1DescriptionMonth
2Sales Data for February 2019February
3Sales Data for March 2019March 20
4
Sheet1
Cell Formulas
RangeFormula
B2=MID(A2,FIND("for",A2)+4,8)
B3=MID(A3,FIND("for",A3)+4,8)
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
If all dates are in 2019, you could use
=SUBSTITUTE(MID(A2,FIND("for",A2)+4,100)," 2019","")
 
Upvote 0
try


Book1
ABCD
1DescriptionMonthMonth
2Sales Data for February 2019FebruaryJanuary
3Sales Data for March 2019MarchFebruary
4March
5April
6May
7June
8July
9August
10September
11October
12November
13December
125
Cell Formulas
RangeFormula
B2=LOOKUP(9.99E+307,SEARCH($D$2:$D$13,A2),$D$2:$D$13)
 
Upvote 0
Alternately
=TRIM(LEFT(SUBSTITUTE(MID(A2,FIND("for",A2)+4,100)," ",REPT(" ",100)),100))
 
Upvote 0
If it always prefixed with "Sales data for" and nothing else then here is another option.


Excel 2013/2016
AB
1DescriptionMonth
2Sales Data for February 2019February
3Sales Data for March 2019March
Sheet1
Cell Formulas
RangeFormula
B2=TEXT(REPLACE(A2,1,15,1),"mmmm")
 
Upvote 0
Thanks for the help Fluff

Please explain how your formula works
 
Upvote 0
Which one?
I would recommend using the formula from FormR, it's a lot neater :)
 
Upvote 0
Agree, it easier to follow


Please explain this part of your formula


Code:
," ",REPT(" ",100)),100))
 
Upvote 0

Forum statistics

Threads
1,217,677
Messages
6,137,941
Members
450,100
Latest member
mscetr

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