multiple criteria count

HRPRGMNGT

New Member
Joined
Feb 2, 2009
Messages
26
I have 2 columns in excel, the first one has a business name and the second one has comments. I now want to count how many times a specific word appears in the comments for a specific business. Is there a formula that does that?

<TABLE style="WIDTH: 360pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=479 border=0 x:str><COLGROUP><COL style="WIDTH: 97pt; mso-width-source: userset; mso-width-alt: 4717" width=129><COL style="WIDTH: 263pt; mso-width-source: userset; mso-width-alt: 12800" width=350><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 97pt; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" width=129 height=17>Column A</TD><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; WIDTH: 263pt; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent" width=350 x:str="Column B ">Column B
</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>Business One</TD><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">I think that service is great and really fast</TD></TR>
<TR style="HEIGHT: 12.75pt" height=17><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>Business Two</TD><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">Products are good service is bad
</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>Business One</TD><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">I think that service is great</TD></TR><TR style="HEIGHT: 12.75pt" height=17><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" height=17>Business Two</TD><TD class=xl25 style="BORDER-RIGHT: #d4d0c8; BORDER-TOP: #d4d0c8; BORDER-LEFT: #d4d0c8; BORDER-BOTTOM: #d4d0c8; BACKGROUND-COLOR: transparent">I think that service is amazing</TD></TR></TBODY></TABLE>

So for example I need a formula that will let me count that Business One has 2 comments with 'great' in it.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Excel Workbook
ABCDE
1BusinessCommentBusiness to search for:Business One
2Business OneI think that service is great and really fastComment to search for:great
3Business TwoProducts are good service is bad
4Business OneI think that service is greatCOUNT2
5Business TwoI think that service is amazing
Sheet1
 
Upvote 0
Column C is whether "Great" appears or not in the comment, if it does, then a 1 is placed, if not, a zero.

=IF(ISERROR(FIND("Great",B1,1)),0,1) {Copy this down}

You can then sumif or sumproduct

=SUMIF(A2:A8,"Business One",C2:C8) or
=SUMPRODUCT((A2:A8="Business One)*(C2:C8)

Lots of things to do to make this more elegant like refer to a cell instead of typing the criteria of "Business One, but this will hopefully put you on the right path.

Jeff
 
Upvote 0
Hi There,

This will also work.

=SUMPRODUCT((A1:A4="Business One")*(IF(ISERROR(FIND("great", B1:B4, 1)), 0, 1)=1))

It is an array formula, so you'll need to enter it by pressing CTRL + SHIFT + ENTER
 
Upvote 0
If you have Excel 2007 or later, you could use the COUNTIFS function

=COUNTIF(A:A, E1, B:B, "*"&E2&"*")

E1 = "Business One"
E2 = "great"
 
Upvote 0

Forum statistics

Threads
1,224,503
Messages
6,179,136
Members
452,890
Latest member
Nikhil Ramesh

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