Analysing Data based on Input Conditions being met

DavidWT87

New Member
Joined
May 10, 2023
Messages
25
Office Version
  1. 2016
Platform
  1. Windows
Hello. If someone can help, I would like to analyse some temperature data and return the low value, once certain conditions are met. The scenario is once my test is at a certain stage (60), the outlet temperature needs to maintain a certain range once it hits a threshold. So I would like to be checking for Column N becoming 60, and then start analysing Column O once it gets below -33, and once that happens, return the lowest value it sees whilst N=60, in one cell, and the highest value it sees in another cell.

So for the attached data, it sees N=60 & O<=-33 from row 29, then checks O29:O51 (stage stops being 60 in row 52), and returns the low value that it finds in a cell.

Once O<=-33, it doesn't matter whether it becomes higher again.

Thanks

Copy of Test 36A 30.03.23 PASS.xlsm
MNO
1TimeDispense StageOutlet Temperature
2100
3220-4.600693
4320-4.528351
5420-4.528351
6520-15.76967
7620-17.69386
8720-18.33044
9820-19.18404
10920-19.63252
111040-19.8206
121140-19.8206
131240-19.8206
141340-20.47165
151440-22.61285
161540-23.78472
171640-24.33449
181760-24.52257
191860-24.52257
201960-24.52257
212060-24.03067
222160-23.85706
232260-23.61111
242360-23.37962
252460-26.50462
262560-27.27142
272660-28.06712
282760-29.62962
292860-33.01
302960-33.04398
313060-33.60822
323160-34.08564
333260-34.72222
343360-35.01158
353460-35.30092
363560-35.47454
373660-35.63368
383760-34.8235
393860-36.03876
403960-36.06771
414060-36.12558
424160-36.14005
434260-36.16898
444360-36.22686
454460-36.24132
464560-36.29919
474660-36.31365
484760-36.31365
494860-36.386
504960-36.386
515060-36.40046
525170-36.386
535270-36.22686
545370-36.08217
555470-35.9809
Sheet4
 
Last edited:

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
How about
Excel Formula:
=AGGREGATE(15,6,O2:O100/(N2:N100=60),1)
 
Upvote 0
How about
Excel Formula:
=AGGREGATE(15,6,O2:O100/(N2:N100=60),1)
Thank you so much. That is way more simple than I anticipated it would be!

Do you have a solution for the other half of my question? (I think I did a bad job of editing my post to include it so may not have been obvious!)

In another cell, I want to return the highest temperature Column O sees after it first sees O<-33 and whilst N=60.

So in the presented data, row 29 is where O first meets the criteria, and this is also the highest temperature. But if in a subsequent row, the temp value was -31.2, that would be the value returned instead.

Thanks
 
Upvote 0
How about
Excel Formula:
=AGGREGATE(14,6,O2:O100/(O2:O100<=-33),1)
 
Upvote 0
How about
Excel Formula:
=AGGREGATE(14,6,O2:O100/(O2:O100<=-33),1)
Unfortunately it doesn't seem like this (or the first answer as it turns out) are quite doing what I was hoping for. On the embedded sheet, I have overwritten a couple of values highlighted in grey.

The formula in Q5 is picking up the -38 and returning it as the lowest temperature which it shouldn't, because Column O hasn't yet reached -33. It is only once -33 has been reached that I would like to search for the lowest value that also has N=60 as a condition.

Similarly, I have overwritten -23 in O34, but the formula in Q9 is not picking up this as the highest temperature, which I would like it to, because it satisfies my initial condition that N=60, and it is after the first point Column O drops below -33.

Auotmated Testing Analysis.xlsm
MNOPQ
1TimeDispense StageOutlet Temperature
2100
3220-4.600693
4320-4.528351LOW VALUE
5420-4.528351-38.00
6520-15.76967
7620-17.69386
8720-18.33044HIGH VALUE
9820-19.18404-33.01
10920-19.63252
111040-19.8206
121140-19.8206
131240-19.8206
141340-20.47165
151440-22.61285
161540-23.78472
171640-24.33449
181760-24.52257
191860-24.52257
201960-24.52257
212060-24.03067
222160-38
232260-23.61111
242360-23.37962
252460-26.50462
262560-27.27142
272660-28.06712
282760-29.62962
292860-33.01
302960-33.04398
313060-33.60822
323160-34.08564
333260-34.72222
343360-23
353460-35.30092
363560-35.47454
373660-35.63368
383760-34.8235
393860-36.03876
403960-36.06771
414060-36.12558
424160-36.14005
434260-36.16898
444360-36.22686
454460-36.24132
464560-36.29919
474660-36.31365
484760-36.31365
494860-36.386
504960-36.386
515060-36.40046
525170-36.386
535270-36.22686
545370-36.08217
555470-35.9809
Sheet4
Cell Formulas
RangeFormula
Q5Q5=AGGREGATE(15,6,O2:O100/(N2:N100=60),1)
Q9Q9=AGGREGATE(14,6,O2:O100/(O2:O100<=-33),1)
 
Upvote 0
Can you have odd values like that in your data?
 
Upvote 0
Can you have odd values like that in your data?
Not quite as odd as I have presented here, (and upon further consideration, ignore the random -38. The formula in Q5 will actually do what I need), but it is possible for the principal to happen around the Q9 formula.

It is equipment that is monitoring temperature over time through various stages of a test. Once stage 60 of the test starts, the temperature has got 30 seconds to get within a target range (this is the other thread for you replied on), and once it gets within that target range, it has to stay in that range for the duration of the stage 60 part of the test.

But if for some reason there is an error, and after it gets into the target range (ie lower than -33), the temperature could theoretically rise again above -33 and I'd like to log what that highest temp is so the test can be tagged as a fail. And that's why I threw the random -23 in there. In reality it would be a smooth progression, but I just wanted to test the formula hence the random value.
 
Upvote 0
Ok, how about
Excel Formula:
=AGGREGATE(14,6,INDEX(O:O,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)):O100/(INDEX(N:N,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)):N100=60),1)
 
Upvote 0
Ok, how about
Excel Formula:
=AGGREGATE(14,6,INDEX(O:O,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)):O100/(INDEX(N:N,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)):N100=60),1)

I think it's so nearly there. With the random -23 in there, it is now picking that up, which is good.

But if I use the formula on the original data I posted on this thread, it returns the cell above as the answer.

A little play about testing it, it looks as if it is including the cell above the first one that is <=-33 within the dataset it is searching through for the highest number.

ie: with the dataset unedited, it returns the highest value as being -29.62962

if I edit that cell (O28) to be -33, then my answer jumps to contents of O27

if I then edit cell O22 to be -33, it returns -23.37962 as the answer (presumably because the cell above (O21) is now not the highest value in the range.
 
Upvote 0
Ok, how about
Excel Formula:
=AGGREGATE(14,6,INDEX(O:O,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)+1):O100/(INDEX(N:N,AGGREGATE(15,6,M2:M100/(O2:O100<=-33),1)+1):N100=60),1)
 
Upvote 0
Solution

Forum statistics

Threads
1,223,897
Messages
6,175,271
Members
452,628
Latest member
dd2

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