HeRoseInThree

Board Regular
Joined
Jan 11, 2018
Messages
103
I have an if formula that has a variable. I'd like to search for a keyword (diesel) and if it is found, return a string. I thought about IF(F23="*diesel",S$33 but that didn't work.

Any ideas?
 
Perhaps you're looking for something like this, guessing here, your description is not clear:

Book3.xlsx
ABR
12in house towing
13555
14
15
16
17Body shop - labor
18
19storage4555
20inspect
21tow555
22
23
24
25storage fees
264555
Sheet756
Cell Formulas
RangeFormula
R13,R26R13=LOOKUP(1,1/SEARCH($A$19:$A$21,R12),$B$19:$B$21)
 
Upvote 0

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Exact same formula as in my Post # 7, and as I said in Post # 8, you can include as many Keywords inside the curly brackets as you want.

If it helps you see it more clearly, I've changed "cake" to $1,500.00

Book3.xlsx
ABC
19tow$1,500.00$1,500.00
20tree 
21Storage$1,500.00
22tree Tow$1,500.00
23flower storage$1,500.00
24flower tow tree$1,500.00
Sheet753
Cell Formulas
RangeFormula
C19:C24C19=IF(SUM(COUNTIF(A19,{"*storage*","*tow*"})),B$19,"")


N&I - BLANK - repair bill - ESTIMATE.xlsx
ABC
19storage4555outside towing
20inspect$ 4,555.00
21tow555
22itowstorage fees
23gas$4,555.00
Sheet1
Cell Formulas
RangeFormula
C20C20=IF(SUM(COUNTIF(A19,{"*storage*","*tow*"})),B$19,"")
C23C23=IF(SUM(COUNTIF(A19,{"*storage*","*tow*"})),B$19,"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C23Cell Value=0textNO
 
Upvote 0
Isn't that what the formula in post#13 does?
Nope. This is that result.
N&I - BLANK - repair bill - ESTIMATE.xlsx
ABC
19storage4555outside towing
20inspect$ 500.00
21tow555
22itowstorage fees
23gas$500.00
Sheet1
Cell Formulas
RangeFormula
C20C20=IF(ISNUMBER(SEARCH("storage",A19)),500,IF(ISNUMBER(SEARCH("tow",A19)),1000,""))
C23C23=IF(ISNUMBER(SEARCH("storage",A19)),500,IF(ISNUMBER(SEARCH("tow",A19)),1000,""))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
C23Cell Value=0textNO
 
Upvote 0
Nope. This is that result.
That's because A19 is storage & not tow.
If it worked, I wouldn't keep asking for help.
Then maybe you need to explain better exactly what you are trying to do, as it stands we are all just guessing.
Please remember that while you know exactly what should happen, where & when. We do not.
 
Upvote 0
Look at my formula in Post # 21 above using your setup in your post # 14 & 17.

Here's my Post #21 formula using your setup in Your post # 22 & 24:

Book3.xlsx
ABC
19storage4555outside towing
20inspect555
21tow555
22itowstorage fees
23gas4555
Sheet757
Cell Formulas
RangeFormula
C20,C23C20=LOOKUP(1,1/SEARCH($A$19:$A$23,C19),$B$19:$B$23)
 
Last edited:
Upvote 0
That's because A19 is storage & not tow.

Then maybe you need to explain better exactly what you are trying to do, as it stands we are all just guessing.
Please remember that while you know exactly what should happen, where & when. We do not.
I really am trying to explain it as well as I can and I REALLY do appreciate the help. I am a little frustrated that I can't get it to work.
 
Upvote 0
I really am trying to explain it as well as I can and I REALLY do appreciate the help. I am a little frustrated that I can't get it to work.
I need a19 to be any of the items (storage, tow or gas) and then Excel determine which dollar value goes with whatever is in a19.

Then, for a20, a21 and so on...
 
Upvote 0

Forum statistics

Threads
1,216,113
Messages
6,128,904
Members
449,477
Latest member
panjongshing

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