Find and extract string from a cell text

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
693
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
I need a formula that finds and extract "month of 2020" in columns A.
Example:
Column A
1 Test
2 Hi
3 1
4 2
5 3
6 This , of course, is the month of december of 2020, ok.
7 Any text.
8 6
9 3
The formula should:
1) Find the cell that starts with "This, of course"; (the patern can appear anywhere in column A) = Row 6
2) Extract text from cell "A6" between the last "of" and the last ",", in this case = "december of 2020".
Is there a way to do that? Thanks.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,694
Office Version
  1. 365
Platform
  1. Windows
You should never use whole column references in a MATCH function.
That said there is nothing wrong with what you have posted.
 

Some videos you may like

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
693
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Is there a way to use MATCH if in the cell have more than 256 char? Like lookup only the first 20 characters of each cell.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,694
Office Version
  1. 365
Platform
  1. Windows
You could use
Excel Formula:
=MATCH("this",LEFT(A1:A2000,4),0)
 

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
693
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
Thanks, works fine.
 
Last edited:

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,694
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

You're welcome & thanks for the feedback.
 

eduzs

Well-known Member
Joined
Jul 6, 2014
Messages
693
Office Version
  1. 2019
  2. 2010
Platform
  1. Windows
You're welcome & thanks for the feedback.
Now I know the cell to extract the text (A50).
How can I extract "december of 2020" from cell A50?
Cell A50 text:
"... x of december of 2015, y...."
Text betweem first "x of " and first ", y" backwards.
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,694
Office Version
  1. 365
Platform
  1. Windows

ADVERTISEMENT

See post#7 ;)
 
Solution

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
55,694
Office Version
  1. 365
Platform
  1. Windows
My pleasure.
 

Watch MrExcel Video

Forum statistics

Threads
1,127,935
Messages
5,627,705
Members
416,268
Latest member
zRGZgDNnmaPhepwviEou

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
Top