extract month from Txt

howard

Well-known Member
Joined
Jun 26, 2006
Messages
6,561
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)
 
As part of the Substitute function, it replace 1 space with 100 spaces, & the last 100 is part of the Left function, taking the 1st 100 characters & that is then trimmed to remove the spaces.
 
Upvote 0

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Hi,

Late to the party, but another option:


Book1
AB
1DescriptionMonth
2Sales Data for February 2019February
3Sales Data for March 2019March
Sheet619
Cell Formulas
RangeFormula
B2=TRIM(LEFT(RIGHT(SUBSTITUTE(A2," ",REPT(" ",100)),200),100))
 
Upvote 0
Thanks for the help Alan. Please explain what 9.99E + 307 means in the formula
 
Upvote 0
Thanks for the help Alan. Please explain what 9.99E + 307 means in the formula

the search() function product an result array, e.g. {false, 2, false, ....}, mainly false (no match) and a number when a match of the month in found.

the largest number excel can handle is 9.99e307 or there about 9 (in fact, any large number will do, just have to be large than the result array), when the lookup() function couldn't find 9.99e307 in the result array it will point to the next less than to that, i.e. the only number in the result array, 2 for this example
 
Upvote 0

Forum statistics

Threads
1,213,527
Messages
6,114,140
Members
448,551
Latest member
Sienna de Souza

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