Number matrix

Dude21

New Member
Joined
Mar 24, 2021
Messages
3
Office Version
  1. 2010
Platform
  1. Windows
I have a number matrix and want to calculate how many times one number appears 2 rows down from another in all columns. E.g. In the first column 46 appears once 2 rows down from 79 and again in column 4. Sometimes I may need to change it to 4 rows down. Thanks for you help.


79
109
23
98
72
70
63
23
46
48
71
40
120
99
81
79
51
88
101
76
75
76
5
46
39
34
31
46
110
62
82
98
51
140
71
95
41
92
90
87
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
@Dude21 Maybe, if you can clarify a couple of things it may help someone to provide a solution.
Is the matrix always 4 x 10 ?
Are you testing for a defined pair of numbers, top and bottom?
 
Upvote 0
Not sure i've understood what you're looking for. See if this does what you need.

Pasta1
ABCDEFG
1ColAColBColCColDCriteriaValue
2791092398Num#179
372706323Num#246
446487140Rows2
5120998179
6518810176Result2
77576546
839343146
9110628298
10511407195
114192908
Plan1
Cell Formulas
RangeFormula
G6G6=SUMPRODUCT((OFFSET(A2:D2,0,0,10-G4)=G2)*(OFFSET(A2:D2,G4,0,10-G4)=G3))


M.
 
Upvote 0
Solution
Thanks Marcelo, will try that.

Snakehips, the matrix size and numbers may change.
 
Upvote 0
That worked. Thanks again Marcelo, very elegant solution.
 
Upvote 0

Forum statistics

Threads
1,215,065
Messages
6,122,945
Members
449,095
Latest member
nmaske

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