counting unique values with two criteria

erniepoe

Active Member
Joined
Oct 23, 2006
Messages
372
Office Version
  1. 365
Platform
  1. Windows
Hi there,

I have the following CSE formula wherein I am trying to find the number of unique values in column C (they pertain to employee ID # and there are several duplicates) if the value in column F is SF, and the value in column H matches what is in cell G33.

The formula is telling me i have too many arguments, but I am unclear as to what I am doing incorrectly. Thanks so much for any help!



=sum(if(frequency(if('labor rpt'!H3:H10277=G33,IF('labor rpt'!F3:F10277="SF",IF('labor rpt'!C3:C10277<>"",MATCH('labor rpt'!C3:C10277,'labor rpt'!C3:C10277,0)))),ROW('labor rpt'!C3:C10277)-MIN(ROW('labor rpt'!C3))+1,1))
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You're missing a closing bracket after +1. Also, one normally uses MIN(ROW(...)) when referencing a range of cells, especially a named range. Otherwise, ROW('labor rpt'!C3:C10277)-ROW('labor rpt'!C3)+1 would suffice when referencing a single cell. Try...

Code:
=SUM(IF(FREQUENCY(IF('labor rpt'!H3:H10277=G33,IF('labor rpt'!F3:F10277="SF",IF('labor rpt'!C3:C10277<>"",MATCH('labor rpt'!C3:C10277,'labor rpt'!C3:C10277,0)))),ROW('labor rpt'!C3:C10277)-MIN(ROW('labor rpt'!C3:C10277))+1)>0,1))

...confirmed with CONTROL+SHIFT+ENTER.

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,213,497
Messages
6,114,002
Members
448,543
Latest member
MartinLarkin

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