MAX Value between 2 Dates in a Range

investntrade

New Member
Joined
Jul 26, 2017
Messages
11
Office Version
  1. 2016
Hello,
I have data in three columns as follows:

Sr. No.DateClose PriceDeadLine
117-Aug-12187.17-Sep-12
221-Aug-12193.657-Sep-12
322-Aug-12190.57-Sep-12
423-Aug-12190.47-Sep-12
524-Aug-12191.95-Oct-12
627-Aug-12187.55-Oct-12
728-Aug-12182.45-Oct-12
829-Aug-12172.355-Oct-12
930-Aug-12172.555-Oct-12
1031-Aug-12171.455-Oct-12
113-Sep-12169.65-Oct-12
124-Sep-12169.955-Oct-12
135-Sep-12164.155-Oct-12
146-Sep-12163.15-Oct-12
157-Sep-12167.055-Oct-12
168-Sep-121705-Oct-12
1710-Sep-12169.755-Oct-12
1811-Sep-12159.35-Oct-12
1912-Sep-12162.65-Oct-12
2013-Sep-12160.155-Oct-12

<tbody>
</tbody>

My requirement is as follows: For a given date (column 2), pickup the DeadLine (column 4), and then select the MAXIMUM value of Close Price (column 3) between the given date and the deadline. For e.g., for 17Aug12 (row. No. 1), the Deadline is 07Sep12. So the returned value should be the MAX from Close Price between row no. 1 and row no. 15, which is 193.65.

I've tried a lot with VLOOKUP and MATCH and ADDRESS functions, but none (or their combinations) is working.

Any help will be greatly appreciated.

Thanks
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Try the following array formula (to be entered using Ctrl+Shift+Enter, not just Enter):

=MAX(IF(($B$2:$B$21>=B2)*($B$2:$B$21<=OFFSET(B2,0,2)),$C$2:$C$21))
 
Upvote 0
Hi give this a try.
Set your start date in E1 and end date in F1. Adjust the formula to suit you.

Use SHIFT+CTL+ENTER not just enter
Code:
{=MAX(IF((B2:B20 > =$E$1),IF(D2:D20 < =$F$1,C2:C20,"")))}
 
Upvote 0
Hello DHayes,

Thanks a ton!
Your reply works perfectly, appreciate the quick turnaround.

Thanks Tetra201, somehow, I am unable to get your formula working, but thanks again for the inputs!.

Hi give this a try.
Set your start date in E1 and end date in F1. Adjust the formula to suit you.

Use SHIFT+CTL+ENTER not just enter
Code:
{=MAX(IF((B2:B20 > =$E$1),IF(D2:D20 < =$F$1,C2:C20,"")))}
 
Upvote 0
Hello Tetra201, Your solution also worked. I had misplaced a cell reference in my earlier try. Sorry about that.
Thanks again
:)
 
Upvote 0

Forum statistics

Threads
1,216,087
Messages
6,128,740
Members
449,466
Latest member
Peter Juhnke

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