combing COUNTIF and COUNTA

webknowhow

New Member
Joined
Nov 4, 2005
Messages
3
I have a spreadsheet with A1:20 listing different codes (A,B,C,D,E) and B1:B20 listing more codes (E,F,G,H,I) with some blanks cells. I have a COUNTIF function for Col A to give me counts by code and a COUNTA function on col B to give me count on non blank cells...but what I am struggling with is combing these two function...i.e. I want to get a count of all code A in column A that does not have a empty cell in col B....I am going google eyed trying to work this out....has anyone got any ideas please.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
21,000
Office Version
  1. 365
Platform
  1. Windows
Try...

=SUMPRODUCT(--(A1:A20="A"),--(B1:B20<>""))

Hope this helps!
 
Upvote 0

webknowhow

New Member
Joined
Nov 4, 2005
Messages
3
Domenic, that is fantastic...works a treat..thank you so much. I have to copy this formula across 50 other cells and each time it changes the A column to B column and the B col to C column...the only one that needs to change is the 2nd function as the A column is static....is there a way to alter the formula so even when copied the first part always relates to the A column?
 
Upvote 0

Domenic

MrExcel MVP
Joined
Mar 10, 2004
Messages
21,000
Office Version
  1. 365
Platform
  1. Windows
Try...

=SUMPRODUCT(--($A$1:$A$20="A"),--(B$1:B$20<>""))

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,195,687
Messages
6,011,158
Members
441,590
Latest member
kukaljcanin

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
Top