How to select number of unique rows of an matrix

M

MightyKitten

I have a matrix where I need to calculate the number of
Unique selections of a single column

An unique selection of a colum is defined as
This colum is the only one who has an X on that row


Consider this matrix

A B C D E F G
+--------------
1|X X
|
2| X
3|X
4| X X X
5| X
6| X X
7| X
8|1 1 0 0 2 0 0 <-- This row I want to calculate

Unique selections:
B2
A3
E5
E7

Is ther a furmula I could put in a single cell so I can Count this number of
Unique rows in a coulumn?

(oh boy I find this one even quite hard to explane)

Thanks In Advance

MK
 
K

Ken Wright

With a helper column in say Col H.

In Cell H1 put =--(COUNTA(A1:G1)=1) or =--(COUNTIF(A1:G1,"X")=1) depending on
whether blanks really are blanks, or have formulas in them returning blanks. If
real blanks then either will work.

Copy down to H7.

Now in cell A8 put =SUMPRODUCT((A$1:A$7="X")*($H$1:$H$7=1))

and copy across to G8
 
H

Harlan Grove

...
...
An unique selection of a colum is defined as
This colum is the only one who has an X on that row ...
Is ther a furmula I could put in a single cell so I can Count this number of
Unique rows in a coulumn?
...

If your matrix were named MAT and if you wanted to use a single formula to
calculate the results for all columns, select a range in a row below MAT
spanning the same number of columns as MAT and enter the array formula

=MMULT(TRANSPOSE(ROW(MAT))^0,(MMULT(--(MAT="X"),
TRANSPOSE(COLUMN(MAT))^0)=1)*(MAT="X"))

Array formulas are entered by holding down [Ctrl] and [Shift] keys before
pressing [Enter].
 
M

MightyKitten

Thanks I'm gonna try your sugestions. Oh boy, looks a bit like higher Math
to mee. I'm realy amazed that there are even peple who know this stuff.
(Menat that in the ncest way possible)

MightyKitten
 
H

Harlan Grove

Thanks I'm gonna try your sugestions. Oh boy, looks a bit like higher Math
to mee. I'm realy amazed that there are even peple who know this stuff.
(Menat that in the ncest way possible)

My left brain sends its regard to your right brain.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top