Count number of cells with a specific text

sajo9670

New Member
Joined
Nov 13, 2012
Messages
31
Hi,
I am trying to count the number of cells matching a text (weekly, monthly, bi-monthly ect). The problem is that the range cannot be A1:A30, rather it is A10;A14;A18;A22....

How would I go about calculating the number of cells in the sheet where the actual sales in catman solution is weekly reported? In this case the answer should be 2.

[TABLE="width: 619"]
<tbody>[TR]
[TD]Column1[/TD]
[TD]Actual sales[/TD]
[TD]Promo sales[/TD]
[TD]Actual sales distribution weight[/TD]
[TD]Promo sales distribution weight[/TD]
[/TR]
[TR]
[TD]Nielsen[/TD]
[TD]Bi-monthly[/TD]
[TD]Bi-monthly[/TD]
[TD]Bi-monthly[/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]CatMan Solution[/TD]
[TD]Weekly[/TD]
[TD]Weekly[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Source 3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Column1[/TD]
[TD]Actual sales[/TD]
[TD]Promo sales[/TD]
[TD]Actual sales distribution weight[/TD]
[TD]Promo sales distribution weight[/TD]
[/TR]
[TR]
[TD]Nielsen[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]CatMan Solution[/TD]
[TD]Weekly[/TD]
[TD]Weekly[/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]Source 3[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
</tbody><colgroup><col><col><col><col><col></colgroup>[/TABLE]
 

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Why can't it be A1:A30? Is it because there are false positives in that range or is it because data wouldn't appear in cells other than A10, A14, A18, etc. If it's because data won't appear, I wouldn't sweat calculating empty cells, as it will return a 0 and won't impact the final count.

Pre-excel 2007 version:

=Sumproduct(--(A1:A30="CatMan Solution"), --(B1:B30="Weekly"))

2007 or greater:
=COUNTIFS(B1:B30,"Weekly",A1:A30,"CatMan Solution")

There's no valid reason why I switched the arguements in the CountifS formula....they return the same value).
 
Upvote 0
It is because of false positives. I need to know the actual sales from only Catman solutions. If I use A1:A30 then the actual sales for Nielsen and source 3 would be included which they should not.
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,871
Members
452,363
Latest member
merico17

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