can the OFFSET reference be a formula?

JWolkie

New Member
Joined
Sep 25, 2006
Messages
8
I've got a formula that adds the 12 most recent item numbers,

=SUM(OFFSET(Y3,-1,-11,1,12))

but I would like the OFFSET(Y3,...) reference to be something like

=MAX(M3:AM3)

so that it automatically adjusts its reference towards the most recent item as I add more to the right of the list. The item number will be the highest, and rightmost, number.

How can I do that?

Thanks!
~Jacob~
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

just_jon

Legend
Joined
Sep 3, 2002
Messages
10,473
Maybe, though not robust

=SUM(INDEX(Y3:IV3,0,MATCH( 9.99999999999999E+307,Y3:IV3)-11):IV3)
 

JWolkie

New Member
Joined
Sep 25, 2006
Messages
8
I guess what my question boils down to is:

Is there a way that a formula's cell reference can be replaced by a function (MAX)? Something like

=CELL("address",OFFSET(M3,0,MATCH(MAX(M3:AZ3),M3:AZ3,0)-1))

can return the address of the MAX, but I don't seem to be able to turn it back around into a formula.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
I guess what my question boils down to is:

Is there a way that a formula's cell reference can be replaced by a function (MAX)? Something like

=CELL("address",OFFSET(M3,0,MATCH(MAX(M3:AZ3),M3:AZ3,0)-1))

can return the address of the MAX, but I don't seem to be able to turn it back around into a formula.

=CELL("address",INDEX(M3:AZ3,MATCH(MAX(M3:AZ3),M3:AZ3,0)))
 

JWolkie

New Member
Joined
Sep 25, 2006
Messages
8

ADVERTISEMENT

> =CELL("address",INDEX(M3:AZ3,MATCH(MAX(M3:AZ3),M3:AZ3,0)))

That gives me the same thing, $Y$3 for example.

How could I get a cell address output, such as $Y$3, to be used as the reference for a formula like

=SUM(OFFSET(Y3,-1,-11,1,12))

?
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
> =CELL("address",INDEX(M3:AZ3,MATCH(MAX(M3:AZ3),M3:AZ3,0)))

That gives me the same thing, $Y$3 for example.

How could I get a cell address output, such as $Y$3, to be used as the reference for a formula like

=SUM(OFFSET(Y3,-1,-11,1,12))

?

=SUM(OFFSET(INDEX(M3:AZ3,MATCH(MAX(M3:AZ3),M3:AZ3,0)),-1,-11,1,12))
 

JWolkie

New Member
Joined
Sep 25, 2006
Messages
8
> =SUM(OFFSET(INDEX(M3:AZ3,MATCH(MAX(M3:AZ3),M3:AZ3,0)),-1,-11,1,12))



... A thing of beauty. Thank you!
 

Forum statistics

Threads
1,141,678
Messages
5,707,780
Members
421,527
Latest member
Tamiwsw

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
Top