count by rows and columns, unique value only

tx12345

Board Regular
Joined
Aug 28, 2006
Messages
165
Hi

i think this is an easy one, but not so easy for me.

is it possible to count a value in each column per row of the range , and then move on to the next row looking for the same?

for example:

Code:
target number: 123 

123 456 345 <-- 123 shows here
123 445 271 <-- 123 shows here
445 445 255 
636 636 300
300 123 123 <-- 123 shows here

so we have three columns wide and 5 rows deep. 123 appears in 3 of the rows (what i want to find) although it appears within the entire range a total of 4 times.

TIA!

tx
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Try this formula
I turned it from Finnish language into English formula, so I hope it's right.

Code:
=IF(SUMPRODUCT(--(A1:A5=A9))=0,0,1)+IF(SUMPRODUCT(--(B5:B5=A9))=0,0,1)+IF(SUMPRODUCT(--(C1:C5=A9))=0,0,1)

In A9 I have 123

Regards
Pekka
:eek: :eek: :eek:
 
Upvote 0
Hi

i think this is an easy one, but not so easy for me.

is it possible to count a value in each column per row of the range , and then move on to the next row looking for the same?

for example:

Code:
target number: 123 

123 456 345<-- 123 shows here
123 445 271<-- 123 shows here
445 445 255 
636 636 300
300 123 123<-- 123 shows here

so we have three columns wide and 5 rows deep. 123 appears in 3 of the rows (what i want to find) although it appears within the entire range a total of 4 times.

TIA!

tx
Book5
ABCDEFG
1targetcount
21234563451233
31234452714452
4445445255
5636636300
6300123123
7
Sheet1


G2, copied down:

=SUMPRODUCT((MMULT(($A$2:$C$6=F2)+0,ROW($A$2:INDEX($A$2:$A$6,COLUMNS($A$2:$C$6)))^0)>0)+0)
 
Upvote 0
Formula in G2 is :

=SUM(--(MMULT(COUNTIF(F2,A$2:C$6),{1;1;1})>0))
 
Upvote 0
Thanks for the responses. The formulas are just what the doctor ordered for the overweight and out of shape spreadsheet

tx
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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