# Dynamic Reference in Offset Function?

#### blogan418

##### New Member
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

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.

#### Fluff

##### MrExcel MVP, Moderator
Excel Formula:
``=MAX(INDEX(B2:B17,MATCH(D17,A2:A17,0)):INDEX(B2:B17,MATCH(D17,A2:A17,0)-10))``

#### blogan418

##### New Member
Excel Formula:
``=MAX(INDEX(B2:B17,MATCH(D17,A2:A17,0)):INDEX(B2:B17,MATCH(D17,A2:A17,0)-10))``
Works perfect. Thanks again!!

#### Fluff

##### MrExcel MVP, Moderator
You're welcome & thanks for the feedback.

Replies
32
Views
725
Replies
8
Views
121
Replies
2
Views
211
Replies
3
Views
195
Replies
5
Views
294

1,127,089
Messages
5,622,641
Members
415,916
Latest member
eugenia

### 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.

### Which adblocker are you using?

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

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