counting unique values with two criteria

erniepoe

Active Member
Joined
Oct 23, 2006
Messages
375
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,214,429
Messages
6,119,433
Members
448,897
Latest member
ksjohnson1970

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