formula to look for certain key words

richard hales

Board Regular
Joined
Feb 18, 2009
Messages
55
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi Everyone

I have a formula which as work great for me for a while now =IF(LEN(A2&B2),IF(COUNT(A2,B2)=0,RIGHT(LOOKUP("zzz",A2:B2),2)+0,""),"") can someone please help me to tweak it a bit more.

Am looking for the formula to look for certain key words.

The formula is placed in C2 and looks into A2 for the certain key word bus and then returns the number back to C2 and the same for D2 key word car & E2 key word Bike.
Screenshot 2022-06-16 181857.jpg

Many thanks
Richard
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
For every possible combination in column A will the numbers always appear at the end of the text - as in "10" is at the end of "bus10"?
 
Upvote 0
Hi DeficientOptimism
Thanks you for taking a look.
Yes the numbers would be at the end of the text. Numbers could arrange from 0.5 to double digits like 10,11,12 etc max number would be 22 if that helps.

 
Upvote 0
With all your data you want to extract the key words from, put them in column A.

Then try this in B2.



=LEFT(A2,SEARCH(SUBSTITUTE(A2,LEFT(A2,MIN(IFERROR(FIND({0,1,2,3,4,5,6,7,8,9},A2),""))-1),""),A2)-1)
 
Upvote 0
123.xlsm
ABCDEFGHIJKL
1BusCarBike
2Car5#VALUE!5#VALUE!
3
4
5Cell contains certain text, need to return the numbers after textIsolate numbers from a text cell
6
7formula
8
Sheet2
Cell Formulas
RangeFormula
C2C2=TRIM(MID(A2,FIND("Bus",A2)+3,99))
D2D2=TRIM(MID(A2,FIND("Car",A2)+3,99))
E2E2=TRIM(MID(A2,FIND("Bike",A2)+4,99))


Hi DeficientOptimism
Thanks for the formula but it wasn't what I was looking for sorry.
Just found the Xl2bb which you can see.
In there I've have a formula the only thing is when I change the data in cell A2 for example Car5 to Bus5 I get the value error, I would like to have a zero. could anyone help me with the correct formula please.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

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