Search multiple keywords in a string

JustinCl

New Member
Joined
Jan 22, 2014
Messages
1
Hi All

I am busy building a spreadsheet that must do the following.

ABCDE
120131101Payment received 1151 John168.571151
220131201Payment received 1153 DLAMINI224.391152
320131101Payment received 1121 DAY-GARDEN365.571153
420131101Payment received 1951 MPHELA641.761154
520131101Payment received 1751 DEBEER208.121155
620131101Payment received 1931 COLSEN62.141156
Mphela

<tbody>
</tbody>


Above is a basic example of the data I am using
What the spreadsheet must do is it must search cell B1 for the key word in in cell E1, if it does not find the keyword, it must search the same cell for the keyword in cell E2 and so on if it finds the key word it must return a consatination of cell A1 and the Keyword.

This is easy enough to do using the search function together with a couple of nested IF statements but where the problem comes in is that I am needing to run the search on about 12000 lines using over 10000 key words.

currently I have sheet with a formula in Column A containing 40 nested IFs searching for the first 40 key the same formula in Column B searching for the next 40 keywords and so on but to search 10 000 keywords(Client name or Client number) I am needing to apply this formula to 250 columns over 12000 line which makes the sheet very resource incentive.

How do I streamline this to make the spreadsheet more efficient


Thanks

<tbody>
</tbody>
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Try...

Code:
D1, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IF(ISNUMBER(MATCH(TRUE,ISNUMBER(FIND(" "&$E$1:$E$6&" "," "&B1&" ")),0)),A1&" - "&INDEX($E$1:$E$6,MATCH(TRUE,ISNUMBER(FIND(" "&$E$1:$E$6&" "," "&B1&" ")),0)),"")
If you're using Excel 2007 or later version, try...

Code:
D1, confirmed with CONTROL+SHIFT+ENTER, and copied down:

=IFERROR(A1&" - "&INDEX($E$1:$E$6,MATCH(TRUE,ISNUMBER(FIND(" "&$E$1:$E$6&" "," "&B1&" ")),0)),"")
 
Upvote 0
This would be work a lot easier if you first isolate the column B codes in their own column first, then you could simply use a vlookup to get your answer. From your sample, it looks like the code is always a four digit code after "payment received", so you could add a new column F with this formula:

=Mid(B1,18,4)

That will return just "1151"

Now in column G use this formula:

=If(IsError(Vlookup(F1,E1:E10000,1,0),"",A1 & Vlookup(F1,E1:E10000,1,0))
 
Upvote 0

Forum statistics

Threads
1,203,171
Messages
6,053,874
Members
444,692
Latest member
Queendom

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