count identical values in 2 rows

P

Piet

I use Excel 2007

I have a table of about 50 columns and 60 rows.
Each row must be compared with the first row of the table:
Is there a formula, that counts the number of cells in each row that has an
identical value with the corresponding cell in the header?
 
M

Mike H

Piet,

Is this what you mean

=COUNTIF(B2:AX2,A2)
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.
 
B

Bob Phillips

For each row

=SUMPRODUCT(--(A2:AX2<>""),--(A2:AX2=$A$1:$AX$1))

and copy dwn
 
M

Ms-Exl-Learner

Assume that you are having the header value in A1 cell and you want to count
and compare it with the 2nd Row from A2 to AX2 then use the below formula.

=COUNTIF(A2:AX2,A1)

You can also protect the cell number by adding an $ (Dollar) symbol like the
below.
=COUNTIF(A$2:AX$2,A$1)

Use the above formula other than A1 cell and A2 to AX2 range.
 
P

Piet

Bob,

thanks for your answer, which helps me a lot.
I have to study the function a while as I don't understand the solution, but
it works nevertheless fantastic!.

Thanks again.

Regards,
Piet
 
P

Piet

Mike,

Thanks for your attemt. But it was not were I was looking for. Bob Philips
gave me the solution.
Thanks for your effort in this.
Regards,
Piet
 
P

Piet

Thanks for your attemt. But it was not were I was looking for. Bob Philips
gave me the solution.
Thanks for your effort in this.
Regards,
Piet
 

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