# extract month from Txt

#### howard

##### Well-known Member
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","")

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)

Alternately
=TRIM(LEFT(SUBSTITUTE(MID(A2,FIND("for",A2)+4,100)," ",REPT(" ",100)),100))

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

Thanks for the help FormR

Thanks for the help Alan

Thanks for the help Fluff

Which one?
I would recommend using the formula from FormR, it's a lot neater

Agree, it easier to follow

Code:
``," ",REPT(" ",100)),100))``

Replies
19
Views
1K
Replies
3
Views
325
Replies
9
Views
215
Replies
1
Views
303
Replies
8
Views
388

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.

### Which adblocker are you using?

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

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