if count and seach criteria. (find part of value en a cells and return with a certain value)

muggi

New Member
Joined
Sep 22, 2004
Messages
38
Hi,
i have below formula, that search a certain cell (c8), and if found any of the search criteria , it should return a value.

=IF(COUNT(SEARCH({"harald";"fakta";"coop";"bilka"};C8));"m";IF(ISNUMBER(SEARCH({"stof";"babysam"};C8));"d";IF(ISNUMBER(SEARCH({"læge";"fysioterapeut"};C8));"L";"")))

But is it possible to change this:

({"harald";"fakta";"coop";"bilka"} and also the 2 other criteria

to a range of cells (each cell with 1 criteria) containing the search criteria, that way it would be easier to maintain the data.
BUT the formula should still be able to seach the C8 and look if part of the value in C8 contains the criteria?

Is it possible ?
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi,

Sure. With e.g. B1:B4 containing "harald","fakta","coop","bilka", C1:C2 containing "stof","babysam" and D1:D2 containing "læge","fysioterapeut":

=IF(COUNT(LOOKUP(32^19,SEARCH(B1:B4,C8))),"m",IF(COUNT(LOOKUP(32^19,SEARCH(C1:C2,C8))),"d",IF(COUNT(LOOKUP(32^19,SEARCH(D1:D2,C8))),"L","")))


Regards
 
Upvote 0
Thank you very much for the help and fast reply. Always people in here taking their time to help others :)

I don't understand what the 32^19 does, but hey it works :)
 
Upvote 0
You're welcome!

(It's just an arbitrarily, though also sufficiently, large number! :))
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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