Adapting a formula to extract text from ANYWHERE in cell

surkdidat

Well-known Member
Joined
Oct 1, 2011
Messages
582
Office Version
  1. 365
Morning!
I have the formula
Excel Formula:
=IFERROR(INDEX('[Tracker.xlsm]Master List'!$A$4780:$A$6000,MATCH(A21,MID('[Tracker.xlsm]Master List'!$B$4780:$B$6000,18,9),0)),"")

which extracts the text I want after the 18th character.

However, I have noticed that I am getting a few blank results, which is due to the requested input not being entirely followed. (ie extra spaces, no spaces which then mess up the extraction.

Can the above formua be adapted so that it still looks up A21 in the above formula, but looks for that ANYWHERE in the referenced cells please? (ie after 17 characters, 19 character, 28 characters etc?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You could try:

Excel Formula:
=IFERROR(INDEX('[Tracker.xlsm]Master List'!$A$4780:$A$6000,MATCH("*"&A21&"*",'[Tracker.xlsm]Master List'!$B$4780:$B$6000,0)),"")
 
Upvote 0
Solution
Hi Surkdidat,

You could remove all space from the searches as long as that doesn't cause an issue.

Surkdidat5.xlsx
AB
4780Rover DogXXXXXXXXXXXXXXXXXHello Dog
4781Kitty CatXXXXXXXXXXXXXXXXXHello Cat
4782Mr MoleXXXXXXXXXXXXXXXXXHello Mole
4783Billy GoatXXXXXXXXXXXXXXXXXHelloGoat
4784Helen HorseXXXXXXXXXXXXXXXXXHello Horse
4785
Master List


Surkdidat5.xlsx
ABCD
20Result
21Hello GoatBilly Goat
Master List
Cell Formulas
RangeFormula
D21D21=IFERROR(INDEX($A$4780:$A$6000,AGGREGATE(15,6,ROW($A$4780:$A$6000)-ROW($A$4779)/(ISNUMBER(SEARCH(SUBSTITUTE(A21," ",""),SUBSTITUTE($B$4780:$B$6000," ","")))),1)),"")
 
Upvote 0

Forum statistics

Threads
1,214,875
Messages
6,122,044
Members
449,063
Latest member
ak94

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