Counting Data that Contains Multiple Variables

L

Legacy 313294

Guest
Hi,

I have a list of terms (list a) and a list of the states (list b) and I want to write a formula that counts when one of the values in list a contains one of the values from list b

Example

list alist b
cars to buy in floridaflorida
florida places to buy carsnew york
new york car rental
buy cars new york

<tbody>
</tbody>

Desired output

OutputCount
florida2
new york2

<tbody>
</tbody>

Normally I would just use =countif(A1, "*florida*") and sum the total, however there are >50 variables on list b and it would be very time consuming. I'm sure there is a way to do this more efficiently, but can't seem to figure it out.

Any help would be much appreciated!
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
not sure this is what you need
list alist b
cars to buy in floridaflorida
florida places to buy carsnew york
new york car rental
buy cars new york
OutputCount
florida2
new york2

<tbody>
</tbody>

row example starts on row 15
array formula used:
=SUMPRODUCT(--(IFERROR(SEARCH(A21,$A$15:$A$18),0)>0))

formula is entered by pressing CTRL+SHIFT+ENTER, which adds the curly brackets.
 
Upvote 0

Forum statistics

Threads
1,218,220
Messages
6,141,231
Members
450,344
Latest member
renslaw

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