Compare numbers in 2 rows and give me a number how many numbers match?

JSolitude

New Member
Joined
Nov 23, 2013
Messages
2
Hello everybody,

I'm pounding my head on the following problem.

Suppose I have a sequence of 7 random numbers in a row, each number in the next column.
(I do know how to randomly generate numbers so this is not the problem).

On the next row I have another sequence of 7 random numbers.

For instance:

1 - 12 - 24 - 31 - 37 - 44
3 - 15 - 27 - 37 - 43 - 45

I'm looking for a formula that would give me as a result 1, because in this case when compared row 1 with row 2, the number 37 was generated twice.

If there would be 2 numbers that would be the same, the formula should give as a result 2, and so on.

I'm thinking about the formula 'compare' or 'search' but how do I construct the formula for the above problem :eek:

Thanks a bunch in advance.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
One way (Note this is an array formula - confirm with ctrl+shift+enter):
Sheet10

*ABCDEFGH
111224313744**
231527374345*1

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"><col style="width:64px;"></colgroup><tbody>
</tbody>

Spreadsheet Formulas
CellFormula
H2{=SUM(IF(COUNTIF(A1:F1,A2:F2),1,0))}

<tbody>
</tbody>
Formula Array:
Produce enclosing
{ } by entering
formula with CTRL+SHIFT+ENTER!

<tbody>
</tbody>


Excel tables to the web >> Excel Jeanie HTML 4
 
Upvote 0
Thank you very much JoeMo. Very nice solution to the problem at hand -why did I not think of this, I'm simply lousy at Excel :rolleyes:

Lucky forums like these and helpful people like you exist.
 
Upvote 0
Thank you very much JoeMo. Very nice solution to the problem at hand -why did I not think of this, I'm simply lousy at Excel :rolleyes:

Lucky forums like these and helpful people like you exist.

You are welcome - thanks for the reply.
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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