Countifs with blank cells

gberg

Board Regular
Joined
Jul 16, 2014
Messages
180
Office Version
  1. 365
Platform
  1. Windows
I have tried to write a countifs formula to give me the number of unique combinations from the data in Column A and Column B. It works fine unless Column B is blank.

Here is the formula

=COUNTIFS($A$2:$A$11,A2,$B$2:$B$11,B2)

When Column B is blank the result is always 0. How can I have it "count" the similar blank columns to give a result?

Opportunity NameConstruction JobOccurances
901 NY Ave Conference Center901 NY Ave (Conference Center)2
901 NY Ave Conference Center901 NY Ave (Conference Center)2
AARP02
AARP02
AARPAARP1
Miles & StockbridgeMiles & Stockbridge1
Miles & Stockbridge01
MintzMintz3
MintzMintz3
MintzMintz3
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
A couple of options:

Book4 (version 1).xlsb
ABCDE
1Opportunity NameConstruction JobOccurances
2901 NY Ave Conference Center901 NY Ave (Conference Center)222
3901 NY Ave Conference Center901 NY Ave (Conference Center)222
4AARP022
5AARP022
6AARPAARP111
7Miles & StockbridgeMiles & Stockbridge111
8Miles & Stockbridge011
9MintzMintz333
10MintzMintz333
11MintzMintz333
Sheet8
Cell Formulas
RangeFormula
C2:C11C2=COUNTIFS($A$2:$A$11,A2,$B$2:$B$11,B2)
D2:D11D2=ROWS(FILTER($A$2:$A$11,($A$2:$A$11=A2)*($B$2:$B$11=B2)))
E2:E11E2=SUMPRODUCT(($A$2:$A$11=A2)*($B$2:$B$11=B2))
 
Upvote 0
Solution
How about:
Code:
=SUMPRODUCT(($A$2:$A$11=A2)*($B$2:$B$11=B2))
 
Upvote 0
The sumproduct solution looks the most simplistic. I will give that a go and see if I have any issues. Always such great help on this site. Thanks for the advice and help!!!!!
 
Upvote 0
This site has a bunch of really smart people! Eric and Phuoc, your solutions work great, how do I mark two replies as a "solution"?

Thanks again for the help!
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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