count how many times certain text appears in one column while meeting criteria from another cell

missrutele

New Member
Joined
Nov 17, 2017
Messages
10
Hello,

I have this data for example. In column A I have country names in column B key words:

[TABLE="width: 295"]
<tbody>[TR]
[TD]Country[/TD]
[TD]Key words[/TD]
[/TR]
[TR]
[TD]Lithuania[/TD]
[TD]tableware; cutlery; pan;pot[/TD]
[/TR]
[TR]
[TD]Germany[/TD]
[TD]bag; backpack; pan[/TD]
[/TR]
[TR]
[TD]Germany[/TD]
[TD]pan; pot; backpack[/TD]
[/TR]
[TR]
[TD]Estonia[/TD]
[TD]bag; backpack;[/TD]
[/TR]
[TR]
[TD]France[/TD]
[TD]cutlery[/TD]
[/TR]
[TR]
[TD]France[/TD]
[TD]pan; pot; backpack[/TD]
[/TR]
[TR]
[TD]Bulgaria[/TD]
[TD]cutlery[/TD]
[/TR]
[TR]
[TD]Lithuania[/TD]
[TD]tableware[/TD]
[/TR]
</tbody>[/TABLE]

I can count how many times appears "cutlery" with formula =SUMPRODUCT((LEN(Table1[[#All],[Key words]])-LEN(SUBSTITUTE(Table1[[#All],[Key words]],"tableware,"")))/LEN("tableware"))

But I need to count for example how many times appears "cutlery" if country is "Lithuania".

It is possible to do that?

Thank you for your help in advance.
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi, you can try like this.

Code:
=SUMPRODUCT(--(Table1[[#All],[Country]]="Lithuania"),(LEN(Table1[[#All],[Key words]])-LEN(SUBSTITUTE(Table1[[#All],[Key words]],"tableware","")))/LEN("tableware"))
 
Upvote 0

Forum statistics

Threads
1,223,885
Messages
6,175,184
Members
452,615
Latest member
bogeys2birdies

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