Using date to pull data

FuelGuy

New Member
Joined
May 31, 2023
Messages
6
Office Version
  1. 2016
Platform
  1. Windows
Have data which is pulled every 15 minutes (or so) 24 hours a day.
Need to isolate data by day and determine gallons of product used per day.
Currently have 3 months of data.
1685565055223.png
 
I had some things backwards above. So, I seeded the tank contents in descending order.
this may look better:

Mr excel questions 39.xlsm
ABCD
1timestamp(CDT)Bulk TankDay
22023-05-25 00:003,543.6842023-05-252883.350433
32023-05-25 00:153,481.5262023-05-26539.4528357
42023-05-25 00:303,423.4442023-05-2798.78095707
52023-05-25 00:453,357.6952023-05-28
62023-05-25 01:003,295.218
72023-05-25 01:153,239.219
82023-05-25 01:303,181.075
92023-05-25 01:453,127.670
102023-05-25 02:003,071.047
112023-05-25 02:153,009.704
122023-05-25 02:302,953.658
132023-05-25 02:452,907.594
142023-05-25 03:002,861.550
152023-05-25 03:152,806.744
162023-05-25 03:302,763.302
172023-05-25 03:452,718.554
182023-05-25 04:002,671.225
192023-05-25 04:152,621.220
202023-05-25 04:302,578.079
212023-05-25 04:452,537.090
222023-05-25 05:002,489.378
232023-05-25 05:152,448.983
242023-05-25 05:302,408.421
252023-05-25 05:452,369.325
262023-05-25 06:002,322.043
272023-05-25 06:152,277.456
282023-05-25 06:302,233.533
292023-05-25 06:452,193.327
302023-05-25 07:002,160.076
312023-05-25 07:152,122.096
322023-05-25 07:302,090.101
332023-05-25 07:452,057.172
342023-05-25 08:002,020.368
352023-05-25 08:151,988.729
362023-05-25 08:301,956.276
372023-05-25 08:451,918.235
382023-05-25 09:001,880.979
392023-05-25 09:151,849.040
402023-05-25 09:301,821.186
412023-05-25 09:451,792.604
422023-05-25 10:001,765.008
432023-05-25 10:151,737.434
442023-05-25 10:301,709.425
452023-05-25 10:451,675.923
462023-05-25 11:001,648.149
472023-05-25 11:151,620.518
482023-05-25 11:301,593.028
492023-05-25 11:451,564.644
502023-05-25 12:001,537.275
512023-05-25 12:151,509.294
522023-05-25 12:301,481.326
532023-05-25 12:451,451.944
542023-05-25 13:001,423.428
552023-05-25 13:151,399.174
562023-05-25 13:301,374.462
572023-05-25 13:451,351.779
582023-05-25 14:001,327.644
592023-05-25 14:151,306.928
602023-05-25 14:301,282.221
612023-05-25 14:451,257.867
622023-05-25 15:001,234.237
632023-05-25 15:151,212.420
642023-05-25 15:301,188.988
652023-05-25 15:451,169.669
662023-05-25 16:001,151.749
672023-05-25 16:151,129.315
682023-05-25 16:301,110.815
692023-05-25 16:451,093.057
702023-05-25 17:001,071.972
712023-05-25 17:151,051.794
722023-05-25 17:301,035.846
732023-05-25 17:451,019.684
742023-05-25 18:001,001.477
752023-05-25 18:15985.945
762023-05-25 18:30969.944
772023-05-25 18:45953.126
782023-05-25 19:00936.942
792023-05-25 19:15919.641
802023-05-25 19:30901.791
812023-05-25 19:45887.483
822023-05-25 20:00870.422
832023-05-25 20:15854.003
842023-05-25 20:30839.062
852023-05-25 20:45825.233
862023-05-25 21:00812.463
872023-05-25 21:15799.998
882023-05-25 21:30786.141
892023-05-25 21:45772.974
902023-05-25 22:00758.446
912023-05-25 22:15745.195
922023-05-25 22:30733.432
932023-05-25 22:45720.713
942023-05-25 23:00709.510
952023-05-25 23:15695.898
962023-05-25 23:30684.321
972023-05-25 23:45671.477
982023-05-26 00:00660.334
992023-05-26 00:15649.796
1002023-05-26 00:30638.543
1012023-05-26 00:45626.526
1022023-05-26 01:00616.706
1032023-05-26 01:15606.068
1042023-05-26 01:30594.212
1052023-05-26 01:45582.400
1062023-05-26 02:00573.168
1072023-05-26 02:15562.428
1082023-05-26 02:30552.770
1092023-05-26 02:45542.009
1102023-05-26 03:00531.185
1112023-05-26 03:15521.546
1122023-05-26 03:30513.633
1132023-05-26 03:45505.478
1142023-05-26 04:00497.394
1152023-05-26 04:15487.907
1162023-05-26 04:30479.983
1172023-05-26 04:45472.192
1182023-05-26 05:00464.580
1192023-05-26 05:15455.750
1202023-05-26 05:30448.539
1212023-05-26 05:45440.665
1222023-05-26 06:00432.816
1232023-05-26 06:15425.686
1242023-05-26 06:30417.535
1252023-05-26 06:45410.638
1262023-05-26 07:00403.995
1272023-05-26 07:15396.040
1282023-05-26 07:30389.116
1292023-05-26 07:45382.132
1302023-05-26 08:00374.628
1312023-05-26 08:15368.145
1322023-05-26 08:30361.310
1332023-05-26 08:45355.041
1342023-05-26 09:00349.219
1352023-05-26 09:15342.345
1362023-05-26 09:30336.263
1372023-05-26 09:45329.960
1382023-05-26 10:00324.835
1392023-05-26 10:15318.774
1402023-05-26 10:30313.177
1412023-05-26 10:45308.057
1422023-05-26 11:00303.320
1432023-05-26 11:15297.707
1442023-05-26 11:30292.744
1452023-05-26 11:45286.902
1462023-05-26 12:00281.424
1472023-05-26 12:15276.664
1482023-05-26 12:30271.995
1492023-05-26 12:45267.291
1502023-05-26 13:00262.175
1512023-05-26 13:15257.836
1522023-05-26 13:30253.037
1532023-05-26 13:45248.602
1542023-05-26 14:00244.132
1552023-05-26 14:15240.252
1562023-05-26 14:30235.912
1572023-05-26 14:45231.569
1582023-05-26 15:00227.715
1592023-05-26 15:15224.059
1602023-05-26 15:30219.733
1612023-05-26 15:45215.752
1622023-05-26 16:00211.795
1632023-05-26 16:15208.316
1642023-05-26 16:30204.839
1652023-05-26 16:45200.835
1662023-05-26 17:00197.746
1672023-05-26 17:15194.324
1682023-05-26 17:30191.075
1692023-05-26 17:45187.850
1702023-05-26 18:00184.631
1712023-05-26 18:15181.804
1722023-05-26 18:30179.019
1732023-05-26 18:45176.302
1742023-05-26 19:00172.914
1752023-05-26 19:15169.778
1762023-05-26 19:30166.878
1772023-05-26 19:45164.338
1782023-05-26 20:00161.601
1792023-05-26 20:15158.464
1802023-05-26 20:30155.548
1812023-05-26 20:45152.621
1822023-05-26 21:00150.130
1832023-05-26 21:15147.176
1842023-05-26 21:30144.666
1852023-05-26 21:45142.396
1862023-05-26 22:00139.715
1872023-05-26 22:15137.143
1882023-05-26 22:30134.564
1892023-05-26 22:45132.490
1902023-05-26 23:00130.058
1912023-05-26 23:15127.659
1922023-05-26 23:30125.371
1932023-05-26 23:45122.912
1942023-05-27 00:00120.881
1952023-05-27 00:15118.680
1962023-05-27 00:30116.393
1972023-05-27 00:45114.615
1982023-05-27 01:00112.431
1992023-05-27 01:15110.446
2002023-05-27 01:30108.749
2012023-05-27 01:45106.846
2022023-05-27 02:00105.186
2032023-05-27 02:15103.085
2042023-05-27 02:30101.439
2052023-05-27 02:4599.787
2062023-05-27 03:0097.990
2072023-05-27 03:1596.460
2082023-05-27 03:3094.961
2092023-05-27 03:4593.087
2102023-05-27 04:0091.683
2112023-05-27 04:1590.108
2122023-05-27 04:3088.351
2132023-05-27 04:4586.774
2142023-05-27 05:0085.362
2152023-05-27 05:1583.900
2162023-05-27 05:3082.471
2172023-05-27 05:4580.981
2182023-05-27 06:0079.554
2192023-05-27 06:1577.971
2202023-05-27 06:3076.701
2212023-05-27 06:4575.283
2222023-05-27 07:0073.902
2232023-05-27 07:1572.774
2242023-05-27 07:3071.424
2252023-05-27 07:4570.046
2262023-05-27 08:0068.834
2272023-05-27 08:1567.573
2282023-05-27 08:3066.554
2292023-05-27 08:4565.370
2302023-05-27 09:0064.187
2312023-05-27 09:1563.006
2322023-05-27 09:3061.869
2332023-05-27 09:4560.659
2342023-05-27 10:0059.520
2352023-05-27 10:1558.624
2362023-05-27 10:3057.640
2372023-05-27 10:4556.675
2382023-05-27 11:0055.818
2392023-05-27 11:1554.729
2402023-05-27 11:3053.814
2412023-05-27 11:4552.941
2422023-05-27 12:0052.057
2432023-05-27 12:1551.109
2442023-05-27 12:3050.256
2452023-05-27 12:4549.264
2462023-05-27 13:0048.385
2472023-05-27 13:1547.610
2482023-05-27 13:3046.875
2492023-05-27 13:4545.943
2502023-05-27 14:0045.150
2512023-05-27 14:1544.438
2522023-05-27 14:3043.583
2532023-05-27 14:4542.893
2542023-05-27 15:0042.074
2552023-05-27 15:1541.316
2562023-05-27 15:3040.570
2572023-05-27 15:4539.884
2582023-05-27 16:0039.131
2592023-05-27 16:1538.353
2602023-05-27 16:3037.596
2612023-05-27 16:4536.864
2622023-05-27 17:0036.310
2632023-05-27 17:1535.671
2642023-05-27 17:3035.083
2652023-05-27 17:4534.513
2662023-05-27 18:0033.825
2672023-05-27 18:1533.211
2682023-05-27 18:3032.548
2692023-05-27 18:4532.050
2702023-05-27 19:0031.559
2712023-05-27 19:1530.959
2722023-05-27 19:3030.494
2732023-05-27 19:4529.906
2742023-05-27 20:0029.384
2752023-05-27 20:1528.879
2762023-05-27 20:3028.394
2772023-05-27 20:4527.914
2782023-05-27 21:0027.357
2792023-05-27 21:1526.829
2802023-05-27 21:3026.347
2812023-05-27 21:4525.873
2822023-05-27 22:0025.438
2832023-05-27 22:1525.016
2842023-05-27 22:3024.587
2852023-05-27 22:4524.110
2862023-05-27 23:0023.651
2872023-05-27 23:1523.198
2882023-05-27 23:3022.837
2892023-05-27 23:4522.485
2902023-05-28 00:0022.100
2912023-05-28 00:1521.671
2922023-05-28 00:3021.341
2932023-05-28 00:4520.980
2942023-05-28 01:0020.601
2952023-05-28 01:1520.266
2962023-05-28 01:3019.933
2972023-05-28 01:4519.550
2982023-05-28 02:0019.216
2992023-05-28 02:1518.924
3002023-05-28 02:3018.548
3012023-05-28 02:4518.187
3022023-05-28 03:0017.875
3032023-05-28 03:1517.605
3042023-05-28 03:3017.332
3052023-05-28 03:4516.990
3062023-05-28 04:0016.671
3072023-05-28 04:1516.350
3082023-05-28 04:3016.047
3092023-05-28 04:4515.729
3102023-05-28 05:0015.476
3112023-05-28 05:1515.167
3122023-05-28 05:3014.888
3132023-05-28 05:4514.595
3142023-05-28 06:0014.323
3152023-05-28 06:1514.088
3162023-05-28 06:3013.858
3172023-05-28 06:4513.584
3182023-05-28 07:0013.371
3192023-05-28 07:1513.138
3202023-05-28 07:3012.916
3212023-05-28 07:4512.706
3222023-05-28 08:0012.511
3232023-05-28 08:1512.299
3242023-05-28 08:3012.064
3252023-05-28 08:4511.874
3262023-05-28 09:0011.660
3272023-05-28 09:1511.475
3282023-05-28 09:3011.277
3292023-05-28 09:4511.106
3302023-05-28 10:0010.922
3312023-05-28 10:1510.754
3322023-05-28 10:3010.586
3332023-05-28 10:4510.384
3342023-05-28 11:0010.183
3352023-05-28 11:1510.015
3362023-05-28 11:309.835
3372023-05-28 11:459.672
3382023-05-28 12:009.493
3392023-05-28 12:159.317
3402023-05-28 12:309.159
3412023-05-28 12:459.001
3422023-05-28 13:008.838
3432023-05-28 13:158.691
3442023-05-28 13:308.557
3452023-05-28 13:458.404
3462023-05-28 14:008.274
3472023-05-28 14:158.120
3482023-05-28 14:307.965
3492023-05-28 14:457.811
3502023-05-28 15:007.666
3512023-05-28 15:157.545
fuelguy
Cell Formulas
RangeFormula
D2:D4D2= INDEX(B2:B351,MATCH((1/LARGE(IFERROR(1/((--($C2=INT(A2:A351)))*(A2:A351)),0),1)),A2:A351,0),1)- INDEX(B2:B351,MATCH((1/LARGE(IFERROR(1/((--($C2+1=INT(A2:A351)))*(A2:A351)),0),1)),A2:A351,0),1)
Getting a #DIV/0!
How to I get a copy of the spreadsheet to you?
 
Upvote 0

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Getting a #DIV/0!
How to I get a copy of the spreadsheet to you?
If you 1) have no blank cells) 2) use the formula I have above EXACTLY you should not get any #DIV/0 errors.

Copy the entire mini worksheet I sent into new worksheet in your workbook (or the same sheet if that works, its better).
If you don't get the errors then move just change the cell references to where your data is.

If you have drop box or other file share services you can post your workbook there. Sanitize your data as needed.
 
Upvote 0
If you 1) have no blank cells) 2) use the formula I have above EXACTLY you should not get any #DIV/0 errors.

Copy the entire mini worksheet I sent into new worksheet in your workbook (or the same sheet if that works, its better).
If you don't get the errors then move just change the cell references to where your data is.

If you have drop box or other file share services you can post your workbook there. Sanitize your data as needed.
 
Upvote 0
What is the purpose of the @ sign in your formula?
Without that, I get this:

data (4).xlsx
ABCDE
1Timestamp (CDT)Bulk TankDay
22023-03-01 15:077983.9642023-03-01 00:00#DIV/0!615.1807
32023-03-01 15:227965.9392023-03-02 00:00#DIV/0!1072.062
42023-03-01 15:377900.1112023-03-03 00:00#DIV/0!1119.082
52023-03-01 15:527809.2052023-03-04 00:00#DIV/0!61.12598
62023-03-01 16:077744.9442023-03-05 00:00#DIV/0!-3.91846
72023-03-01 16:227697.1402023-03-06 00:00#DIV/0!1162.184
82023-03-01 16:377697.1402023-03-07 00:00#DIV/0!1133.971
92023-03-01 16:527588.2102023-03-08 00:00#DIV/0!-6159.65
102023-03-01 17:077551.3782023-03-09 00:00#DIV/0!1401.203
112023-03-01 17:227531.0032023-03-10 00:00#DIV/0!1118.297
data (4)
Cell Formulas
RangeFormula
D2D2=INDEX(B2:B8955,MATCH((1/LARGE(IFERROR(1/((--($C2=INT(A2:A8955)))*(A2:A8955)),0),1)),A2:A8955,0),1)-INDEX(B2:B8955,MATCH((1/LARGE(IFERROR(1/((--($C2+1=INT(A2:A8955)))*(A2:A8955)),0),1)),A2:A8955,0),1)
E2:E11E2=INDEX($B$2:$B$8955,MATCH((1/LARGE(IFERROR(1/((--($C2=INT($A$2:$A$8955)))*($A$2:$A$8955)),0),1)),$A$2:$A$8955,0),1)-INDEX($B$2:$B$8955,MATCH((1/LARGE(IFERROR(1/((--($C2+1=INT($A$2:$A$8955)))*($A$2:$A$8955)),0),1)),$A$2:$A$8955,0),1)
C3:C11C3=C2+1
D3:D11D3=INDEX(B3:B8956,MATCH((1/LARGE(IFERROR(1/((--($C3=INT(A3:A8956)))*(A3:A8956)),0),1)),A3:A8956,0),1)-INDEX(B3:B856,MATCH((1/LARGE(IFERROR(1/((--($C3+1=INT(A3:A8956)))*(A3:A8956)),0),1)),A3:A8956,0),1)
 
Upvote 0
Solution
What is the purpose of the @ sign in your formula?
Without that, I get this:

data (4).xlsx
ABCDE
1Timestamp (CDT)Bulk TankDay
22023-03-01 15:077983.9642023-03-01 00:00#DIV/0!615.1807
32023-03-01 15:227965.9392023-03-02 00:00#DIV/0!1072.062
42023-03-01 15:377900.1112023-03-03 00:00#DIV/0!1119.082
52023-03-01 15:527809.2052023-03-04 00:00#DIV/0!61.12598
62023-03-01 16:077744.9442023-03-05 00:00#DIV/0!-3.91846
72023-03-01 16:227697.1402023-03-06 00:00#DIV/0!1162.184
82023-03-01 16:377697.1402023-03-07 00:00#DIV/0!1133.971
92023-03-01 16:527588.2102023-03-08 00:00#DIV/0!-6159.65
102023-03-01 17:077551.3782023-03-09 00:00#DIV/0!1401.203
112023-03-01 17:227531.0032023-03-10 00:00#DIV/0!1118.297
data (4)
Cell Formulas
RangeFormula
D2D2=INDEX(B2:B8955,MATCH((1/LARGE(IFERROR(1/((--($C2=INT(A2:A8955)))*(A2:A8955)),0),1)),A2:A8955,0),1)-INDEX(B2:B8955,MATCH((1/LARGE(IFERROR(1/((--($C2+1=INT(A2:A8955)))*(A2:A8955)),0),1)),A2:A8955,0),1)
E2:E11E2=INDEX($B$2:$B$8955,MATCH((1/LARGE(IFERROR(1/((--($C2=INT($A$2:$A$8955)))*($A$2:$A$8955)),0),1)),$A$2:$A$8955,0),1)-INDEX($B$2:$B$8955,MATCH((1/LARGE(IFERROR(1/((--($C2+1=INT($A$2:$A$8955)))*($A$2:$A$8955)),0),1)),$A$2:$A$8955,0),1)
C3:C11C3=C2+1
D3:D11D3=INDEX(B3:B8956,MATCH((1/LARGE(IFERROR(1/((--($C3=INT(A3:A8956)))*(A3:A8956)),0),1)),A3:A8956,0),1)-INDEX(B3:B856,MATCH((1/LARGE(IFERROR(1/((--($C3+1=INT(A3:A8956)))*(A3:A8956)),0),1)),A3:A8956,0),1)

It looks like you tried to take the @ sign out in the next row. But, you did not lock your ranges as absolute (with the $ signs).
Column E has a consistent formula all the way down.
 
Upvote 0
What is the purpose of the @ sign in your formula?
That is just probably because you are opening the file in 365.

@FuelGuy you need to confirm the formula with Ctrl Shift Enter, rather than just Enter.
 
Upvote 0
It looks like you tried to take the @ sign out in the next row. But, you did not lock your ranges as absolute (with the $ signs).
Column E has a consistent formula all the way down.
I wasn't using column E. However, between your formula and Fluff's Control Shift Enter it works now. Did notice that the daily totals are off by 5 - 10 gallons but that's good enough for my purposes. Thanks to everybody!
 
Upvote 0

Forum statistics

Threads
1,215,073
Messages
6,122,977
Members
449,095
Latest member
Mr Hughes

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