Trying to find start and end times in a date/time column with a difficult twist.

renraw9002

New Member
Joined
Jun 20, 2024
Messages
15
Office Version
  1. 365
Platform
  1. Windows
Ok here's the problem. I have a date and time column we'll call column A. Column A has a matching column B where a temperature value is located. Column A+B only record a value every 5 minutes and even then it's not exactly 5 minutes every time. Occasionally it'll be 5 and 13 or 18 seconds, etc.

I have column C with the start date and time, in a matching format to A, and I have column D with the end date and date time of when a ton of processes have obviously started and ended. However column C and D are populated whenever someone records they started or ended that respective process which could be any time at all. Except in that case C and D never bother recording the seconds so it'll at least be on a minute. What I'm trying to find is the lowest and highest temp from column B from between the start and end times of columns C and D... and then do it probably about 900-1000 more times.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Edit: also even with column B only recording a value every 5 minutes. The start and end times of one process are 2 weeks apart so a value every 5 minutes. It'll be around 4,000 values in column B to search through for the lowest and highest temps. So if excel is not the tool for this job please let me know.
 
Upvote 0
This should be doable with VBA - can you post some example data (30-40 lines should do it), preferably using XL2BB if you can but in a table is OK if not.
 
Upvote 0
Would this work?:

Data extends to row 4001.

Book6.xlsx
ABCDEF
1DatetimeTempStartDatetimeEndDatetimeMinMax
201/08/2024 12:01:464501/08/2024 12:01:0001/08/2024 12:53:00197
301/08/2024 12:05:371401/08/2024 15:09:0001/08/2024 16:09:00594
401/08/2024 12:07:589202/08/2024 05:51:0702/08/2024 07:01:002100
501/08/2024 12:09:4749
601/08/2024 12:11:4640
701/08/2024 12:16:0691
801/08/2024 12:17:4197
901/08/2024 12:19:0560
1001/08/2024 12:20:441
1101/08/2024 12:24:3989
1201/08/2024 12:25:4252
Sheet2
Cell Formulas
RangeFormula
E2:F4E2=LET(d,FILTER($B$2:$B$4001,($A$2:$A$4001>=C2)*($A$2:$A$4001<=D2)), HSTACK(MIN(d),MAX(d)))
Dynamic array formulas.
 
Upvote 0
This should be doable with VBA - can you post some example data (30-40 lines should do it), preferably using XL2BB if you can but in a table is OK if not.

I am really sorry for the long delay. Work has me going in 5 different directions. Also unfortunately this is a work laptop that the spreadsheet is on and I can't download stuff onto it. Without using xl2bb i don't know how to show a table so here's a pair of photos. The first photo has 30 or so sample batch numbers that have start and end times listed. The second photo is a snippet from one of the excel files that has the temperature readings from a small stretch of time. I have temperature readings from every 5 minutes like the ones shown in the second photo from the beginning of the month all the way back to the middle of 2022. As you can see in the first photo the start and end times are roughly 2 weeks apart so searching a column that has readings from every 5 minutes is a lot of values to search for. I also have probably 350 batches with start and end times to search with.
 

Attachments

  • excelhelp1.png
    excelhelp1.png
    72.2 KB · Views: 15
  • excelhelp2.png
    excelhelp2.png
    36.9 KB · Views: 14
Upvote 0
Another option. It looks to me like your start and end times are text, hence the 'VALUE' in the formulas, but if that's not the case you can remove it.

Book1
ABCDEFGH
1DateTimeValueBatch numberStartEndMinMax
230/04/2024 20:2036.0815000123456729/04/2024 17:00:0030/04/2024 23:00:0036.081537.8089
330/04/2024 20:1437.3000123456830/04/2024 04:00:0030/04/2024 19:00:0036.288937.8089
430/04/2024 18:4236.434
530/04/2024 18:1136.5577
630/04/2024 16:0736.8773
730/04/2024 15:4236.8338
830/04/2024 15:0137.8089
930/04/2024 14:2836.9866
1030/04/2024 14:2137.1033
1130/04/2024 11:1936.4048
1230/04/2024 11:0137.6452
1330/04/2024 10:3636.2889
1430/04/2024 09:4937.6378
1530/04/2024 07:2536.6916
1630/04/2024 06:0537.4612
1730/04/2024 05:2637.4139
1830/04/2024 04:5036.4908
1930/04/2024 04:4837.3292
2030/04/2024 03:5736.5097
2130/04/2024 03:4236.8389
2230/04/2024 02:1636.6743
2330/04/2024 01:2836.3914
2430/04/2024 00:3436.6245
Sheet1
Cell Formulas
RangeFormula
G2:G3G2=MINIFS($B$2:$B$24,$A$2:$A$24,">=" & VALUE($E2),$A$2:$A$24,"<=" &VALUE($F2))
H2:H3H2=MAXIFS($B$2:$B$24,$A$2:$A$24,">=" & VALUE($E2),$A$2:$A$24,"<=" &VALUE($F2))
 
Upvote 0
Would this work?:

Data extends to row 4001.

Book6.xlsx
ABCDEF
1DatetimeTempStartDatetimeEndDatetimeMinMax
201/08/2024 12:01:464501/08/2024 12:01:0001/08/2024 12:53:00197
301/08/2024 12:05:371401/08/2024 15:09:0001/08/2024 16:09:00594
401/08/2024 12:07:589202/08/2024 05:51:0702/08/2024 07:01:002100
501/08/2024 12:09:4749
601/08/2024 12:11:4640
701/08/2024 12:16:0691
801/08/2024 12:17:4197
901/08/2024 12:19:0560
1001/08/2024 12:20:441
1101/08/2024 12:24:3989
1201/08/2024 12:25:4252
Sheet2
Cell Formulas
RangeFormula
E2:F4E2=LET(d,FILTER($B$2:$B$4001,($A$2:$A$4001>=C2)*($A$2:$A$4001<=D2)), HSTACK(MIN(d),MAX(d)))
Dynamic array formulas.

I think this one is working! I managed to test it on a month's worth of values and they all populated fine. When I get some time I'll verify the values are in fact correct, but a cursory look at things it looks like this was what I needed. Thank you both so much.
 
Upvote 0
Thanks for the feedback.
Let me know how it goes after checking the results.
 
Upvote 0

Forum statistics

Threads
1,224,811
Messages
6,181,082
Members
453,021
Latest member
Justyna P

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