Check for Word in One Cell and process another cell

Somniloquist

New Member
Joined
Jul 3, 2011
Messages
10
Hi All Excellers out there... :)

Need a huge help...

I've some files where the data is like this....

Column Result
---------------------------------------
Wireless not working WLAN
Faulty HDD <wbr> HDD
Prob with Optical Drive ODD
and so on...

The Result is the column that are empty and i need to fill them
The Column is the column that have some sentences already

To Explain, The Column field will have generic sentences with symbols and so on.. Just like a normal sentence.
The Result column needs to have a word depending on what is in the sentence...
Hope that makes sense...
This thing works for one...
=IF(ISNUMBER(SEARCH("Wireless"<wbr>,E343)),"WLAN","")
What this did for me was search for the word wireless in cell E343 and returned value WLAN for me in my required cell.

Is there any way to do this for multiple values... Like build a small reference column and this would replace it from there just like how vlookup would work..
Please help me out on this. Please ask away anything that u need to know.

PS. I could have sent the data file. But its sensitive data with my company which im not allowed to.
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Not sure if I am on the right track. It sounds like you want to search each cell value in a particular range for a number of possible substrings, such as "wireless", and then if found return a corresponding value from some other lookup range. If this is the case then it sounds much easier to do with VBA/A macro than in a formula.

But I think that a long painful formula could do it. If the list of values being searched for is not too long you could do something like:

= IF(ISNUMBER(SEARCH("Wireless"<WBR>,E343)),"WLAN",
IF(ISNUMBER(SEARCH("NextValue"<WBR>,E343)),"ReturnThis",
""))
 
Upvote 0
Hi and welcome to the Board...are you awake now or posting in your sleep...LOL !!
I'd consider making a bit of a library using a VLOOKUP table OR using maybe the InStr function in a macro.
Either way I think your going to be finding the keyword AND the required word manually to create your table....which kinda defeats the purpose !!

As Hamburgler stated it depends on how many words and keywords you have !!
 
Upvote 0
Here is a custom function that may get you started. If you press ALT+F11 it will open the Excel VB Editor. You can then right click on any part of your workbook in the project window on the left side and select "Insert Module". You can then paste the code into the new empty module and you should be able to use it like a normal worksheet function. You can add additional "elseif" lines as needed. I am running something in Excel at the moment so I cant test it. Yell out if you have any problems.

Code:
Function FAULTTYPE(rng as range) as string
    dim x as string
    x=lcase(rng.value)
    if instr(x,"wireless") then
        FAULTTYPE = "WLAN"
    elseif instr(x,"hard drive") then
        FAULTTYPE = "HDD"
    elseif instr(x,"optical") then
        FAULTTYPE = "OPT"
    else
        FAULTTYPE = "UNKNOWN"
    endif
end function
 
Upvote 0
TY Both So much for responding... :)
PS> Not Asleep. Never Expected for such a fast reply... :)

I am at home atm so i do not have access to the file. I will surely run a check and provide you with more updates.

In order to explain a bit more - this is what i gotta do...
EG:
Column E has sentences with my required keywords like x,y,z, n so on...
Now i wanna make a table so that
Found Replace With
x xx
y yy
z zz

I need Column F to have the the replaced values only.

Its more like - I read the string , get that keyword and paste it in Column F

Thank You...
 
Upvote 0

Forum statistics

Threads
1,224,518
Messages
6,179,254
Members
452,900
Latest member
LisaGo

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