Array formula help

Steve17701

New Member
Joined
Mar 17, 2023
Messages
12
Office Version
  1. 2019
Platform
  1. Windows
test.xlsx
FGHIJK
4I am using Excel 2019 on Windows. I have a table of numbers I want to count the number of matches with the numbers above, In cell D3 I used a Count(Match()) array formula and it works. However, when I tab to add a new row the the formula in D3 changes. The first parameter to the Match function becomes a two dementional array, as does the the formula in D6. Why? What am I doing wrong? Is there a better way?
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Sheet1
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
test.xlsx
ABCDEFGHIJKL
1123
2
3
4n1n2n3countI am using Excel 2019 on Windows. I have a table of numbers I want to count the number of matches with the numbers above, In cell D3 I used a Count(Match()) array formula and it works. However, when I tab to add a new row the the formula in D3 changes. The first parameter to the Match function becomes a two dementional array, as does the the formula in D6. Why? What am I doing wrong? Is there a better way?
511032
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
Sheet1
Cell Formulas
RangeFormula
D5D5=COUNT(MATCH(A5:C5,$A$1:$C$1,0))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
How about
Excel Formula:
=SUM(COUNTIFS(Table2[@[n1]:[n3]],$A$1:$C$1))
Change Table name to suit.
 
Upvote 0
Solution
The second parameter to countifs evaluates to #value. I know I can use sumproduct but the formula gets lengthy for larger data sets.
 
Upvote 0
Did you confirm the formula with Ctrl Shift Enter?
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0
You could try SumProduct.

T202303a.xlsm
ABCDEF
1123
2
3
4n1n2n3countCumulSumProduct
5110322
612333
716322
8
9
10
11n1n2n3countCumulSumProduct
12110322
1312333
1416322
3b
Cell Formulas
RangeFormula
D5:D7D5=SUM(COUNTIFS(Table4[@[n1]:[n3]],$A$1:$C$1))
F5:F7F5=SUMPRODUCT(--(Table4[@[n1]:[n3]]=$A$1:$C$1))
F12:F14F12=SUMPRODUCT(--(A12:C12=$A$1:$C$1))
 
Upvote 0

Forum statistics

Threads
1,215,543
Messages
6,125,429
Members
449,223
Latest member
Narrian

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