Find The minimum value in a range within a range.

AJPlant

New Member
Joined
Sep 20, 2021
Messages
3
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
Hi,

Not sure if what I want to do is even possible in excel, but let me give an example of what I am trying to automate.

I have two columns of data that is exported to me (Very large). I have shortened the one in the example to easily explain what I want to do.
Column A tracks the elapsed time in milliseconds
Column B tracks the Load measurement.

I want to automatically find the highest "Minimum" load value that is held for 3 seconds, within the range of loads above a given target load.

So in my example, you can see for a target load of 80N, the highest minimum load value that is held for 3 seconds is 100. However, there are numerous ranges that are held for 3 seconds as seen by the other boxes I have made to illustrate this point.

Is it possible to automate this process to tell me this information? Currently I am looking through the datasets manually - which are much longer and are not as easy to instantly distinguish the highest minimum load at first glance as the example I provided. Thanks very much in advance!

1632149537254.png
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
or is this just highlighting anything that is higher than target load cell which has 80 and higher than 3000 ms

what in your example is the
highest minimum load at first glance as the example I provided.
81 , as that is the nearest to 80 and the minimum to 80
OR 84 ???
Not sure why its 100
the highest minimum load value that is held for 3 seconds is 100
as thats 6seconds
OR is that difference between the 3 seconds and where it reaches max load and then hold for an additional 3 seconds

so if 23 seconds it reached 80 , then held for 3 seconds would be 26 seconds - whats the load then - but it could be lower

sorry , i'm probably missing something ?
not sure what the BOXED text is for or what you want there

in conditional formatting you could use
=AND ( $A2 >= 3000 , $B2 >= $C$2 )

i'll add to spreadsheet and post sample here using XL2BB

Book2
ABC
1Elapsed mSLoad CellTarget Load
21000080
3200020
4300066
5400084
6500095
76000100
87000105
98000107
10900093
111000081
121100074
131200060
141300033
15140003
Sheet3
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:B17Expression=AND($A2>=3000,$B2>=$C$2)textNO


Will it always be a curve distribution , so goes up and then comes down , never oscillates in the middle - bell curve type of thing
Tensile strength testing i guess, from my college days 40+ years ago
 
Last edited:
Upvote 0
Hi,

Thanks for your response!

I am probably doing a poor job of explaining, but when I say "Highest Minimum Load Above Target load for 3 seconds", I mean:

- For any 3 second period within the range above the target load (green cells), what 3 second period gives you the highest minimum load. So the boxes I provided as examples are some of the "3 second periods above target load of 80". As you can see, the centre box has loads of "100", "105" and "107". Thus, the highest minimum load in a 3 second period above the target load is 100 - Since the other boxes have values lower than 100 in their 3 second period.

The data is always a curve distribution as you say, that is why in the mini dataset I provided, I reversed the load back down towards 0. to show that while a max load of 107 was reached, the 3 second period from 107 to 81, has a lower "minimum load above target load" than the 100 to 107, 3 second period.

Perhaps I can simplify my goal further with the following sentence.

What is the maximum load that was maintained at or above the target load for 3 consecutive seconds?



I hope I have cleared up any confusion and not made it worse!
 
Upvote 0
Still clarifying , but if my assumption is correct then this may do
=AND($A2>3000,$B2>=$C$2,$B2=MAX($B$2:$B$15))
BUT you would need to know the full range of results to get the max - is that easy ? or does it need to be automated

So assuming that all we are doing is making sure that A2 is greater than 3000 - or we could add a greater or = >=
and that B2 is greater or equal to the LOAD target
And we then want the MAX in the list which meets those conditions

i have just shown the conditional formatting formula in column D - its not necessary to show this for the conditional formatting to work
BUT so you see the logic

Book4
ABCD
1Elapsed mSLoad CellTarget LoadFormula - example
21000080FALSE
3200020FALSE
4300066FALSE
5400084FALSE
6500095FALSE
76000100FALSE
87000105FALSE
98000107TRUE
10900093FALSE
111000081FALSE
121100074FALSE
131200060FALSE
141300033FALSE
15140003FALSE
Sheet2
Cell Formulas
RangeFormula
D2:D15D2=AND(A2>3000,B2>=$C$2,B2=MAX($B$2:$B$15))
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:C15Expression=AND($A2>3000,$B2>=$C$2,$B2=MAX($B$2:$B$15))textNO


This will find ALL the values
as shown in green on your sheet
=AND(A2>=3000,B2>=$C$2,B2>=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2))
 
Last edited:
Upvote 0
Added the range where the criteria is met - in green
The max value - in red
The Min value - in yellow
D to G are just for illustration and NOT used in the conditional formatting FYI Only

Book4
ABCDEFGH
1Elapsed mSLoad CellTarget LoadFormula - Max example Formula - ALL Meet MIN example Min valueMinMax
21000080FALSEFALSEFALSE81107
3200020FALSEFALSEFALSE81107
4300066FALSEFALSEFALSE81107
5400084FALSETRUEFALSE81107
6500095FALSETRUEFALSE81107
76000100FALSETRUEFALSE81107
87000105FALSETRUEFALSE81107
98000107TRUETRUEFALSE81107
10900093FALSETRUEFALSE81107
111000081FALSETRUETRUE81107
121100074FALSEFALSEFALSE81107
131200060FALSEFALSEFALSE81107
141300033FALSEFALSEFALSE81107
15140003FALSEFALSEFALSE81107
Sheet2
Cell Formulas
RangeFormula
D2:D15D2=AND(A2>3000,B2>=$C$2,B2=MAX($B$2:$B$15))
E2:E15E2=AND(A2>=3000,B2>=$C$2,B2>=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2))
F2:F15F2=AND(A2>=3000,B2>=$C$2,B2=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2))
G2:G15G2=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2)
H2:H15H2=MAXIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2)
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A2:C15Expression=AND($A2>=3000,$B2>=$C$2,$B2=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2))textNO
A2:C15Expression=AND($A2>3000,$B2>=$C$2,$B2=MAX($B$2:$B$15))textNO
A2:C15Expression=AND($A2>=3000,$B2>=$C$2,$B2>=MINIFS($B$2:$B$15,$B$2:$B$15,">="&$C$2))textNO
 
Upvote 0
Thanks very much for your responses Etaf. Apologies for the delayed reply I have been moving house in the last week and so have been very busy! I will have a look at your formulas and plug them into one of the actual data sets I have and see if it works as intended.

Getting the Max is easy enough, doesn't necessarily need to be automated.
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,315
Members
449,081
Latest member
tanurai

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