Sumproduct - count unique

The Horse

Board Regular
Joined
Feb 20, 2004
Messages
68
Can't quite find the answer to my specific problem on here - help gratefully received...

Three columns of time-recording data:

A: Name
B: Project name
C: Project Live / Dead

Obviously, SUMPRODUCT((A2:A5000="MyName")*(C2:C5000="Live"))

gives me all the instances of "MyName" against live projects...how do I incorporate the project name element to get a count of the unique instances of:

"MyName""Live""Project ABC"
"MyName""Live""Project DEF"

etc ?

Thanks

Mick the Horse
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Try

Code:
=SUMPRODUCT(--(A2:A5000="My Name"),--(B2:B5000="ABC"),--(C2:C5000="Live"))

This will give you all the instances of "My Name" where project is "ABC" and is live... just change the parameters to match what you are looking for...

:)
 
Upvote 0
Can't quite find the answer to my specific problem on here - help gratefully received...

Three columns of time-recording data:

A: Name
B: Project name
C: Project Live / Dead

Obviously, SUMPRODUCT((A2:A5000="MyName")*(C2:C5000="Live"))

gives me all the instances of "MyName" against live projects...how do I incorporate the project name element to get a count of the unique instances of:

"MyName""Live""Project ABC"
"MyName""Live""Project DEF"

etc ?

Thanks

Mick the Horse
It's not real clear what you're asking.

Can you post some sample data and tell us what result you expect?
 
Upvote 0
If you want a count of how many unique project codes are in column B when column A is "MyName" and column C is "Live" then an array formula ( entered using Ctrl-Shift-Enter instead of Enter ) like this may do what you want:

=SUM(IF(FREQUENCY(IF(A2:A5000="MyName",IF(C2:C5000="Live",MATCH(B2:B5000,B2:B5000,0))),ROW(INDIRECT("1:"&ROWS(data!A2:A5000)))),1,0))
 
Upvote 0
Glenn,

absolutely on the money - thanks very much !!!

As a CSE formula, it does take a bit of calc time - don't suppose anyone knows a SUMPRODUCT version ?

However, Glenn, your formula works - so that's all that matters for now.

Kudos !!!

Mick the Horse
 
Upvote 0
If you want a count of how many unique project codes are in column B when column A is "MyName" and column C is "Live" then an array formula ( entered using Ctrl-Shift-Enter instead of Enter ) like this may do what you want:

=SUM(IF(FREQUENCY(IF(A2:A5000="MyName",IF(C2:C5000="Live",MATCH(B2:B5000,B2:B5000,0))),ROW(INDIRECT("1:"&ROWS(data!A2:A5000)))),1,0))

Glenn,

absolutely on the money - thanks very much !!!

As a CSE formula, it does take a bit of calc time - don't suppose anyone knows a SUMPRODUCT version ?

However, Glenn, your formula works - so that's all that matters for now.

Kudos !!!

Mick the Horse
A SUMPRODUCT version would not be as efficient as the SUM/FREQUENCY version.

However, I would use this non-volatile version.

Still array enterd.

=SUM(IF(FREQUENCY(IF(A2:A5000="MyName",IF(C2:C5000="Live",MATCH(B2:B5000,B2:B5000,0))),ROW(B2:B5000)-ROW(B2)+1),1))
 
Upvote 0
Biff,


Presumably getting the INDIRECT function (the only volatile factor that I can spot) out of the formula speeds recalc up a little then ? This works also !

Your help was much appreciated !!

Mick the Horse
 
Upvote 0
Biff,


Presumably getting the INDIRECT function (the only volatile factor that I can spot) out of the formula speeds recalc up a little then ? This works also !

Your help was much appreciated !!

Mick the Horse
Removing the volatile INDIRECT function will stop that already slow** formula from recalculating every time a calculation takes place.

** It's slow due to the size of the ranges involved.

Excel sorely needs an efficient built-in function to count uniques!
 
Upvote 0

Forum statistics

Threads
1,224,603
Messages
6,179,850
Members
452,948
Latest member
UsmanAli786

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