Counting Unique Cells based on 2 values in other columns

ultracyclist

Active Member
Joined
Oct 6, 2010
Messages
271
Office Version
  1. 365
Platform
  1. Windows
Hi,

I need help with a formula. I’m counting unique cells in Column B and want to add criteria that looks column J for the value of 21 and Column K for Hardware. If both criteria match the unique value, it will count.

Here’s two formulas that I’ve tried with no luck

=COUNTA(UNIQUE(B16:B972,$J:$SJ="21","*Hardware*",K:K))

=SumIF (Unique(B2:B900),($J:$J='21'),($K:$K='Hardware')

Network Budget-SDWAN-Meraki-11-1-Master Final.xlsx
BCDEFGHIJK
1Site CodePurchase YearCost Type
2COLB21Hardware
3COLB21Software
4COLB
5COLB
6COLB
7COLB
8COLI21Hardware
9COLI21Software
10COLI
11PITA21Hardware
12PITA21Software
13PITA
14PITA
15LOED21Hardware
16LOED21Software
17LOED
US Switch Replacements(Master)
Cells with Data Validation
CellAllowCriteria
J1List=$Q$2:$Q$3
J2:J17List=$O$2:$O$7
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
If we took your example as representative then since every "Hardware" has 21 and a unique Site code, all you would need would be this. ;)
=COUNTIF(Table3[Cost Type],"Hardware").
the same you can do with example from post#1
=COUNTIF(K2:K17,"Hardware")

imo, the best option is a PivotTable, no formula, no PQ, no vba and doesn't matter any blank columns
 
Upvote 0
the same you can do with example from post#1
=COUNTIF(K2:K17,"Hardware")
Exactly, which is why I suspect the sample is not representative, why I have suggested a formula that will ensure a count of unique items with conditions, and why I pointed out that
there is nothing in that SUMPRODUCT formula that assures a count of unique values
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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