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

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
Try...

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

Hope this helps!
 
Upvote 0
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
Try...

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

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,225,768
Messages
6,186,918
Members
453,386
Latest member
testmaster

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