Counting The Number Of Non-Duplicate Cells ??

Aitch

Board Regular
Joined
Jan 27, 2019
Messages
119
Office Version
  1. 2010
Platform
  1. Windows
What is the easiest way to count cells with the same value, across columns?

[TABLE="class: grid, width: 100, align: center"]
<tbody>[TR]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jack[/TD]
[TD]Jill[/TD]
[TD]John[/TD]
[TD]Jane[/TD]
[TD][/TD]
[TD]4[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jack[/TD]
[TD]Jack[/TD]
[TD]John[/TD]
[TD]John[/TD]
[TD][/TD]
[TD]2[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Jill[/TD]
[TD]Jill[/TD]
[TD][/TD]
[TD]Jill[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]John[/TD]
[TD]Jack[/TD]
[TD]Jack[/TD]
[TD]Jane[/TD]
[TD][/TD]
[TD]3[/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


The first 4 columns have names as above, and column F has the number of non-duplicates - I hope I'm explaining it okay!

Thanks for the help!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi there, you can do this with a formula like

=SUMPRODUCT(1/COUNTIF(data,data&""))

In your example if it starts in A1, then the formula in F3 would be: =SUMPRODUCT(1/COUNTIF(A3:D3,A3:D3&""))


NB I didn't create this formula - I have found it in the past and saved it for future use - I cant remember now where it came from.
 
Last edited:
Upvote 0
In F2 control+shift+enter, not just enter, and copy down:

=SUM(IF(FREQUENCY(IF(A2:D2<>"",MATCH(A2:D2,A2:D2,0)),COLUMN(A2:D2)-COLUMN(A2)+1),1))

which is a tad faster option.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,170
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