Referencing whole row number range by Formula result

bukimi

Board Regular
Joined
Apr 12, 2017
Messages
105
Office Version
  1. 2019
Platform
  1. Windows
Hello!

I'm writing a complex formula that starts with AVERAGEIFS. It counts average in specified row number for a number of conditions, but that row number is dynamic. How to make it work?

Simple example:
Excel Formula:
=SUM(5:5)
gives sum of everything in row 5.
Excel Formula:
=MATCH(111008;A:A;0)
shows me the position of "111008" product number in column A, which is 5.
Excel Formula:
=SUM(MATCH(111008;A:A;0):MATCH(111008;A:A;0))
is wrong. I tried to add some "" here and there, but can't make it work equivalent to =SUM(5:5) formula.

Finally, I'd like to replace 111008 with cell reference too, but the principle of referencing whole row number is what I can't get right.
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
There is no issue with MATCH, but you will need to use it with INDEX. Don't forget the last comma in the INDEX function, as that tells the function to use all of the columns in the row.
Edit: Probably better to limit the INDEX reference to include only the range needed for subsequent operations:
MrExcel_20240131_C (version 1).xlsx
ABCDE
3b2
4123
5
6a456
7b123
8c789
Sheet7
Cell Formulas
RangeFormula
C3C3=AVERAGE(INDEX(B6:D8,MATCH(B3,A6:A8,0),))
C4:E4C4=INDEX(B6:D8,MATCH(B3,A6:A8,0),)
Dynamic array formulas.
 
Upvote 0
Solution

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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