multiple max and min and date using aggregate

dmheller

Board Regular
Joined
May 26, 2017
Messages
142
Office Version
  1. 365
I have column A as date and time down to the min. and column B as a number from -2500 to 2500. I want to ignore any negative numbers but I want to capture a date and time on the Min and max as many times as it cycles. i tried =IFERROR(INDEX(N:N,AGGREGATE(4,6,ROW($N$5:$N$388624)/($O$5:$O$388624>0)/((O5:O388624="value")),ROWS($C$3:$C$3))),"")
I am putting this date into C and the max value i want in D and then another date in E and the Min in F.
I also need help finding that value if i can get that as well. I could be way off. snap shot of the numbers is like this. so what i am looking for is capturing 1/5/21 11:04 and 24 then you can see it goes positive again 11/5/21 11:15 and 1993. this will happen many times over the year so i am trying to capture them all. thanks for the help.
1/5/2021 11:01​
25​
1/5/2021 11:01​
25​
1/5/2021 11:01​
25​
1/5/2021 11:02​
25​
1/5/2021 11:02​
25​
1/5/2021 11:02​
25​
1/5/2021 11:03​
25​
1/5/2021 11:03​
25​
1/5/2021 11:03​
25​
1/5/2021 11:04​
25​
1/5/2021 11:04​
25​
1/5/2021 11:04​
24​
1/5/2021 11:05​
24​
1/5/2021 11:05​
-1035​
1/5/2021 11:05​
25​
1/5/2021 11:06​
25​
1/5/2021 11:06​
31​
1/5/2021 11:06​
29​
1/5/2021 11:07​
32​
1/5/2021 11:07​
27​
1/5/2021 11:07​
-1389​
1/5/2021 11:08​
-1395​
1/5/2021 11:08​
-1395​
1/5/2021 11:08​
-1395​
1/5/2021 11:09​
-1395​
1/5/2021 11:09​
-1395​
1/5/2021 11:09​
-1395​
1/5/2021 11:10​
-1395​
1/5/2021 11:10​
-1395​
1/5/2021 11:10​
-1395​
1/5/2021 11:11​
-1395​
1/5/2021 11:11​
-1395​
1/5/2021 11:11​
-1395​
1/5/2021 11:12​
-1395​
1/5/2021 11:12​
-1395​
1/5/2021 11:12​
-1395​
1/5/2021 11:13​
-1395​
1/5/2021 11:13​
-1395​
1/5/2021 11:13​
-1395​
1/5/2021 11:14​
-1395​
1/5/2021 11:14​
-1395​
1/5/2021 11:14​
-1395​
1/5/2021 11:15​
-1395​
1/5/2021 11:15​
-1394​
1/5/2021 11:15​
1993​
1/5/2021 11:16​
1988​
1/5/2021 11:16​
1989​
1/5/2021 11:16​
1985​
1/5/2021 11:17​
1963​
1/5/2021 11:17​
1977​
1/5/2021 11:17​
1944​
1/5/2021 11:18​
1931​
 
You're not going to be able to clean up messy data with a single formula. Adding a helper column to the data source to categorise each row is the only realistic way of getting anywhere close to what you want. I will be very surprised if this works as needed with your full data set, but stranger things have happened.

This will grab the first value that is less then 30 (not necessarily the min), it will then ignore all values until it reaches the first value higher than 1990 (not necessarily the max), from this point it will ignore all values until it dips below 30 again, then repeating the cycle.

Book1 (version 1) (version 1).xlsb
CDEFNOP
1datemaxdatemin
21/5/21 11:03251/5/21 11:151993
3
4datePoundsBin
51/5/21 11:03251
61/5/21 11:0425 
71/5/21 11:0425 
81/5/21 11:0424 
91/5/21 11:0524 
101/5/21 11:05-1035 
111/5/21 11:0525 
121/5/21 11:0625 
131/5/21 11:0631 
141/5/21 11:0629 
151/5/21 11:0732 
161/5/21 11:0727 
171/5/21 11:07-1389 
181/5/21 11:08-1395 
191/5/21 11:08-1395 
201/5/21 11:08-1395 
211/5/21 11:09-1395 
221/5/21 11:09-1395 
231/5/21 11:09-1395 
241/5/21 11:10-1395 
251/5/21 11:10-1395 
261/5/21 11:10-1395 
271/5/21 11:11-1395 
281/5/21 11:11-1395 
291/5/21 11:11-1395 
301/5/21 11:12-1395 
311/5/21 11:12-1395 
321/5/21 11:12-1395 
331/5/21 11:13-1395 
341/5/21 11:13-1395 
351/5/21 11:13-1395 
361/5/21 11:14-1395 
371/5/21 11:14-1395 
381/5/21 11:14-1395 
391/5/21 11:15-1395 
401/5/21 11:15-1394 
411/5/21 11:1519933
421/5/21 11:161988 
431/5/21 11:161989 
441/5/21 11:161985 
451/5/21 11:171963 
Sheet6
Cell Formulas
RangeFormula
C2:D2C2=FILTER(N5:O45,P5:P45=1,"")
E2:F2E2=FILTER(N5:O45,P5:P45=3,"")
P5:P45P5=IF(O5>0,IF(MATCH(O5,{0,30,1990})<>IFERROR(LOOKUP(1E+100,P$4:P4),0),LOOKUP(O5,{0,30,1990},{1,"",3}),""),"")
Dynamic array formulas.
thanks, the helper column works well enought for what i need.
 
Last edited:
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,214,932
Messages
6,122,323
Members
449,077
Latest member
jmsotelo

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