Count Unique

mole999

Well-known Member
Joined
Oct 23, 2004
Messages
10,524
Office Version
  1. 2019
  2. 2016
  3. 2013
Platform
  1. Windows
I want to do a count of unique numbers in column C
7797
7800
7428
7797
where the Font is not RED
and returns a count against a user ID in Col J
IR1-
IR2-
IR3-
Any Ideas
If RED Font is in issue in 2013 then ignore that
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Re: Flumoxed - Count Unique

UDF acceptable?

1 suggestion, read range into array, remove any with red font, then use a dictionary of user IDs to count against the non red numbers?

To be honest, it's a little vague! Can you expand on the example - how does the unique number map to an ID? (assuming count of rows in column C is > column J?)
 
Upvote 0
Re: Flumoxed - Count Unique

Numbers in C and ID's in J, right?

If so, create an additional range with colors say in K, if there isn't one.


Now invoke, control+shift+enter, not just enter:

=SUM(IF(FREQUENCY(IF($J$2:$J$100=P2,IF($K$2:$K$100=R2,$C$2:$C$100)),$C$2:$C$100),1))

where P2 houses an ID of interest and R2 a color of interest.
 
Upvote 0
Re: Flumoxed - Count Unique

Thanks Aladin, I'm away from the machine that has the file currently. Just a quick rough example. IR1- would get a 1 count, due to the duplicate values, and ignoring the Red Font. IR2- would have a 3 count as all unique, and I will place the sums in a row above, expecting to do =IR1- type reference so i get a unique count against an ID
Excel Workbook
ABCDEFGHIJ
1IR1-IR2-
213
3
4Not Count4567IR1-
54985IR2-
63456IR1-
71267IR2-
82345IR2-
9Not Count3456IR1-
Sheet1
 
Last edited:
Upvote 0
Re: Flumoxed - Count Unique

UDF acceptable?

1 suggestion, read range into array, remove any with red font, then use a dictionary of user IDs to count against the non red numbers?

To be honest, it's a little vague! Can you expand on the example - how does the unique number map to an ID? (assuming count of rows in column C is > column J?)

I currently have eight unique User IDs, the numbers in column C would be reports against the same machine. Red already indicates there is a problem with the machine that isn't quickly rectifiable so not being penalised for not resolving. It also eliminates over counting of what needs to be resolved
 
Upvote 0
Re: Flumoxed - Count Unique

My Solution to this is to sort the table by the numbers then insert a column in which you then use an if statement
=IF(C2=C1,0,1)

Thus bringing up a 1 for each unique number, and a zero for a repeated one.

Copy and paste values then sort the table back the way it was before

Count of unique = the sum of the numbers in the inserted column
 
Upvote 0
Re: Flumoxed - Count Unique

My Solution to this is to sort the table by the numbers then insert a column in which you then use an if statement
=IF(C2=C1,0,1)

Thus bringing up a 1 for each unique number, and a zero for a repeated one.

Copy and paste values then sort the table back the way it was before

Count of unique = the sum of the numbers in the inserted column

sorry but no, sorting and sorting is not an option, the issues are date ordered for a reason
 
Upvote 0
Re: Flumoxed - Count Unique

Create in column D either manually or with code the color coding. Once this done, you can run the array formula I forwarded.
 
Upvote 0
Re: Flumoxed - Count Unique

i look forward to doing that tomorrow, thank you

how would D be referenced in =SUM(IF(FREQUENCY(IF($J$2:$J$100=P2,IF($K$2:$K$100=R2,$C$2:$C$100)),$C$2:$C$100),1))
 
Last edited:
Upvote 0
Re: Flumoxed - Count Unique

i look forward to doing that tomorrow, thank you

how would D be referenced in =SUM(IF(FREQUENCY(IF($J$2:$J$100=P2,IF($K$2:$K$100=R2,$C$2:$C$100)),$C$2:$C$100),1))



Book1
BCDEFGHIJ
1IR1-IR2-
213
3
4Not Count4567redIR1-
54985blackIR2-
63456blackIR1-
71267blackIR2-
82345blackIR2-
9Not Count3456blackIR1-
Sheet1


In H2 control+shift+enter, not just enter, copy across to I2...

=SUM(IF(FREQUENCY(IF($J$2:$J$100=H$1,IF($D$2:$D$100<>"red",$C$2:$C$100)),$C$2:$C$100),1))
 
Upvote 0

Forum statistics

Threads
1,224,819
Messages
6,181,153
Members
453,021
Latest member
Justyna P

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