Distinct Count if the value of another field is > 0

Edwardryez

New Member
Joined
Apr 28, 2014
Messages
48
Trying to modify the formula below:
{= SUM(IF(C2:C233<>"",1/COUNTIF(C2:C233,C2:C233)))}
Based on the Values in the column:
H2:H233<>""

How can i put this together?
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
No problem.

It is not exactly an obvious formula is it?

Anyway, I am glad it worked.
Thanks for letting me know.

Regards,
 
Upvote 0
Trying to modify the formula below:
{= SUM(IF(C2:C233<>"",1/COUNTIF(C2:C233,C2:C233)))}
Based on the Values in the column:
H2:H233<>""

How can i put this together?

COUNTIF(S) is not very efficient to use in such a task...

http://www.mrexcel.com/forum/excel-questions/292473-performance-formulas-unique-count.html

Control+shift+enter, not just enter:
Rich (BB code):

=SUM(IF(FREQUENCY(IF(C2:C233<>"",IF(H2:H233<>"",
    MATCH("~"&C2:C233,C2:C233&"",0))),ROW(C2:C233)-ROW(C2)+1),1))
 
Upvote 0
Hi Aladin,

Being sceptical, I compared the two formulas. I extended the range to C2:C10000 to make it obvious.
On my PC, my formula took about 15 seconds and yours took about 2 seconds!

OK, I am convinced :)
Your link looks interesting as well so thank you for your input.

Regards,
 
Upvote 0
... and if I use a timer and time just the worksheet mine takes 14.8 seconds and yours takes about 0.00026 for 9,999 rows.

I think that must be on the verge of a clear victory. ;)
 
Upvote 0
Hi Aladin,

Being sceptical, I compared the two formulas. I extended the range to C2:C10000 to make it obvious.
On my PC, my formula took about 15 seconds and yours took about 2 seconds!

OK, I am convinced :)
Your link looks interesting as well so thank you for your input.

Regards,

... and if I use a timer and time just the worksheet mine takes 14.8 seconds and yours takes about 0.00026 for 9,999 rows.

I think that must be on the verge of a clear victory. ;)

:cool: Thanks for reassurance.
 
Upvote 0

Forum statistics

Threads
1,214,585
Messages
6,120,391
Members
448,957
Latest member
Hat4Life

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