If cell contains certain text, then return value

CRISTINA1128

New Member
Joined
Jun 21, 2016
Messages
9
Hello, I'm working in EXCEL 2016 and trying to create a formula where If cell contains certain text, then return value.

I have the text in column B and would like to create a formula that returns the values in column A.

Any help is greatly appreciated ;)

COLUMN ACOLUMN B
1PAK - FCPAUL
2ANP - FCANDY
3HOUNALINI
4SUKHY - UKSUKHY

<tbody>
</tbody>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Code:
=IF(SEARCH("???",B1)>0,A1,"TEXT NOT FOUND")

replace "???" with what you are looking for, you can reference the cell that has the value you are looking for too

you could write that formula in C1 and drag down.
 
Last edited:
Upvote 0
Thank you for your help - however, Column B has 4 different salesreps (their names are PAUL, ANDY, NALINI and SUKHY). And I want to create a formula that recognizes these names and return a value in Column A (their initials - like what I detailed in Column A).

I could do a search & replace....but I just thought I could create a formula to do this as well.

THANK YOU AGAIN! I love this forum and always recv such great advise/tips! :)
 
Upvote 0
Thank you for your help - however, Column B has 4 different salesreps (their names are PAUL, ANDY, NALINI and SUKHY). And I want to create a formula that recognizes these names and return a value in Column A (their initials - like what I detailed in Column A).

I could do a search & replace....but I just thought I could create a formula to do this as well.

THANK YOU AGAIN! I love this forum and always recv such great advise/tips! :)

You use combination of index and match then...

Code:
=INDEX(A1:A4,MATCH("PAUL",B1:B4,0))

this looks for the position of "PAUL" in B1:B4 and returns the value of the same position in A1:A4
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,098
Messages
6,128,812
Members
449,468
Latest member
AGreen17

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