Date of Max Value in Date Range

wobble12

Board Regular
Joined
Nov 12, 2002
Messages
78
Office Version
  1. 365
I have a Table with over 7000 rows of flow data (daily totals), and four columns.

Columns are:
Date
Flow from River
Flow to River
Bio In

I have used maxif to find the max value for a given date range (either quarterly or yearly), but I would like to return the date that the max value occurred.

I need a formula for the date for "Flow to River" max in a given date range please.

Does anyone have a formula to acheive this please?

All data is in date order.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
With dates in col A (a1:a8) and values in col B I built a formula like
Excel Formula:
=FILTER(A1:A8,B1:B8=MAX(FILTER(B1:B8,(A1:A8>A2)*(B1:B8<A7),"")),"")
It works, but it's probably overkill (BTA it's the first time I use the FILTER function which is part of O365)
So you should add your XL version to your profile to avoid losing time eventually:)
 
Upvote 0
Thank you!
Good point about the version. We are running Excel365, so have spill functions, and maxifs etc.
 
Upvote 0
This partially works, and the way it doesn't work is weird.
When I set the date range for Q1 & Q2, it works, but Q3 & Q4, it wants to do spills of dates for some reason.

And when I try to do column C (Flow to River (m3) , and also wants to spill to three dates.
So this works:
=FILTER(TableFlow[Date],TableFlow[Flow from River (m3)]=MAX(FILTER(TableFlow[Flow from River (m3)],(TableFlow[Date]>DATE($L$20,1,1))*(TableFlow[Date]<DATE($L$20,4,1)),"")),"")

But this doesn't:
=FILTER(TableFlow[Date],TableFlow[Flow from River (m3)]=MAX(FILTER(TableFlow[Flow from River (m3)],(TableFlow[Date]>DATE($L$20,10,1))*(TableFlow[Date]<DATE($L$20+1,1,1)),"")),"")

And this doesn't work either (non-contiguous columns, but at the same rows):
=FILTER(TableFlow[Date],TableFlow[Flow to River (m3)]=MAX(FILTER(TableFlow[Flow to River (m3)],(TableFlow[Date]>DATE($L$20,1,1))*(TableFlow[Date]<DATE($L$20,4,1)),"")),"")

The ones that don't work seem to spill, and also not display the correct dates
 
Upvote 0
Can you post some sample data.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
And of course there is the MAXIFS function...
 
Upvote 0
And of course there is the MAXIFS function...
I used maxifs to find the actual max values for each quarter and year, but I can't seem to use it to get the date of the max value.

Its a function that I was most pleased when it came out.
 
Upvote 0
Unfortunately, our IT guys aren't in today, so unable to install anything. I'll try on Monday.

Thank you again.
 
Upvote 0

Forum statistics

Threads
1,215,523
Messages
6,125,321
Members
449,218
Latest member
Excel Master

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