Searching a partial string within a column, and returning a value.

edward8503

New Member
Joined
Jul 8, 2011
Messages
2
Hello All,

I haven't used these forums before, I hope someone will be able to help!

Basically, I have two sheets:

In one sheet, I have a column of descriptions:

Column A:
Accrual for ADP
Grant true up
Consulting FESCO fee

In the second sheet, I have a column of keywords and associated vendors:

Column A, Column B
ADP, ADP INC
Grant, GRANT THORNTON LLP
E&Y, ERNST & YOUNG LLP
FESCO, FESCO CONSULTING

For each description, I wanted to see if I could find a way to search the description for a keyword, then return the vendor associated with that keyword.

For example: Since "Accrual for ADP" has the keyword "ADP" in it, it would return "ADP INC" in the cell.

I was trying index() and find() functions, but to no avail. I would appreciate any help!
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
Welcome to the Board!

Try like this:

<table style="font-family:Arial,Arial; font-size:10pt; background-color:#ffffff; padding-left:2pt; padding-right:2pt; " border="1" cellpadding="0" cellspacing="0"> <colgroup><col style="font-weight:bold; width:30px; "><col style="width:140px;"><col style="width:155px;"><col style="width:13px;"><col style="width:52px;"><col style="width:155px;"></colgroup><tbody><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td>
</td><td>A</td><td>B</td><td>C</td><td>D</td><td>E</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">1</td><td>Accrual for ADP</td><td>ADP INC</td><td>
</td><td>ADP</td><td>ADP INC</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">2</td><td>Grant true up</td><td>GRANT THORNTON LLP</td><td>
</td><td>Grant</td><td>GRANT THORNTON LLP</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">3</td><td>Consulting FESCO fee</td><td>FESCO CONSULTING</td><td>
</td><td>E&Y</td><td>ERNST & YOUNG LLP</td></tr><tr style="height:17px ;"><td style="font-size:8pt; background-color:#cacaca; text-align:center; ">4</td><td>
</td><td>
</td><td>
</td><td>FESCO</td><td>FESCO CONSULTING</td></tr></tbody></table>
Formula in B1 copied down is:

Code:
=LOOKUP(9.99999999999999E+307,SEARCH(" "&D$1:D$4&" "," "&A1&" "),E$1:E$4)

Matty
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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