Can UNIQUE be used within COUNTIFS?

Mariner

New Member
Joined
Dec 12, 2005
Messages
25
I'm trying to count active cranes based on certain criteria. Normally I would use COUNTIFS to filter my key performance indicators to just hours and for the sum of activity over the trailing twelve months to be greater than 0. This would look something like this: +COUNTIFS($G$5:$G$885,$G925,$AP$5:$AP$885,">0").

The problem is if a given crane moved to another location within the period, it will show up again. That means I need to filter my formula to be sensitive to only unique values so I won't double count.

Below, you'll see that my initial count includes the highlighted crane twice.

1670956146763.png


How can I revise my COUNTIFS formula to only include unique values in column F? Or is there a better way altogether?

Thank you,
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
No, but COUNTIFS can be used with UNIQUE! :rolleyes:
Book2
ABCD
1NameCountUniqueCount
2Felix1Aryanna1
3Rohan1Belen1
4Nyasia1Ezra1
5Tara2Felix2
6Aryanna1Glenn1
7Meagan1Jaheim1
8Jaheim1Meagan1
9Felix1Mekhi1
10Selina1Nyasia1
11Rohan3Rohan3
12Glenn1Selina1
13Ezra1Tara1
14Rohan
15Belen
16Mekhi
Sheet1
Cell Formulas
RangeFormula
B2:B13B2=COUNTIFS(A2:A16,SORT(UNIQUE(A2:A16)))
C2:C13C2=SORT(UNIQUE(A2:A16))
D2:D13D2=COUNTIFS(A2:A16,C2#)
Dynamic array formulas.

Of course, with no context, it's kind of useless! Hence the SORT in the formula in B2, so that it would match the list in C2.
It could all go in one cell too:
Book2
F
2Aryanna - 1
3Belen - 1
4Ezra - 1
5Felix - 2
6Glenn - 1
7Jaheim - 1
8Meagan - 1
9Mekhi - 1
10Nyasia - 1
11Rohan - 3
12Selina - 1
13Tara - 1
Sheet1
Cell Formulas
RangeFormula
F2:F13F2=SORT(UNIQUE(A2:A16)) & " - " & COUNTIFS(A2:A16,SORT(UNIQUE(A2:A16)))
Dynamic array formulas.
 
Upvote 0
In J10, it shows how many different cranes ran for at least one hour.
MrExcelPlayground14.xlsx
FGHIJ
8Hours
9UnitKPIActuals
10AHours106
11BHours20
12CHours0
13DHours20
14AHours15
15EHours10
16FHours15
17GHours
18EHours10
19HHours10
Sheet27
Cell Formulas
RangeFormula
J10J10=ROWS(UNIQUE(FILTER(F10:F19,(G10:G19=G8)*(H10:H19>0))))
 
Upvote 0

Forum statistics

Threads
1,223,714
Messages
6,174,052
Members
452,542
Latest member
Bricklin

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