Dynamic Reference in Offset Function?

blogan418

New Member
Joined
Feb 4, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hi - I'm trying to set a dynamic starting reference for the OFFSET function. The purpose of the calculation is return (in cell E17) the maximum price over the next 10 days starting from a certain dynamic date.

In Cell D17, I've been able to create a formula which determines the date (from Column A) on which the search for maximum price must begin.

What I'd like to do is take that Date (in column A) and begin a search for the maximum price over the next 10 days (in Column B).

The base of the formula I've tried to use is

=MAX(OFFSET(???,-1,0,-10,1))

What I can't determine is what to put in the initial reference given that the date in D17 can change.

Book1.xlsx
ABCDE
1DatePriceTrade Trigger PriceFirst Date in which Price is Greater than Trade Trigger PriceMaximum Price 10 Days After the Date of the Trade Trigger
212/12/2008387.53
312/11/2008402.64
412/10/2008419.85
512/9/2008423.31
612/8/2008410.07
712/5/2008402.32
812/4/2008420.70
912/3/2008400.05
1012/2/2008379.70
1112/1/2008395.00
1211/28/2008395.90
1311/26/2008384.56
1411/25/2008379.89
1511/24/2008351.23
1611/21/2008350.00
1711/20/2008369.92371.0111/25/2008
Sheet1
Cell Formulas
RangeFormula
D17D17=LOOKUP(2,1/(OFFSET(B17,-1,0,-10,1)>=C17),OFFSET(A17,-1,0,-10,1))
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
How about
Excel Formula:
=MAX(INDEX(B2:B17,MATCH(D17,A2:A17,0)):INDEX(B2:B17,MATCH(D17,A2:A17,0)-10))
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,797
Messages
6,121,629
Members
449,041
Latest member
Postman24

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