Max of close values

rdubs

New Member
Joined
Sep 30, 2022
Messages
9
Office Version
  1. 365
Platform
  1. MacOS
Hi there, I hope someone can help.

I have data points for time/speed of moving objects.
The datapoints are clustered within short periods (approx 1.5 seconds), with differing time intervals between each cluster.
I need to find the max value within in a cluster, and also count the clusters.
I tried grouping, but this groups at regular intervals, sometimes splitting the clusters.
TIA


Speed clusters.xlsx
ABCDEF
1
2timespeedtime as number
308:01:11.5017.8444833.3341608912
408:01:11.5508.0844833.3341614583
508:01:11.60614.2844833.3341621065
608:01:11.64917.6744833.3341626042
708:01:11.6997.4844833.3341631829
808:01:11.7929.5544833.3341642593
908:01:11.8628.7244833.3341650694
1008:01:11.91714.6844833.3341657060
1108:01:11.96111.8444833.3341662153
1208:01:12.01517.9644833.3341668403
1308:01:12.07117.8844833.3341674884
1408:01:12.11417.4944833.3341679861
1508:01:12.15618.8144833.3341684722
1608:01:12.19621.3644833.3341689352
1708:01:12.23814.2144833.3341694213
1808:01:12.28019.5444833.3341699074Ungrouped
1908:01:12.33319.9344833.3341705208TimeMax. of speed
2008:01:12.38519.6144833.334171122744833.33416089127.84
2108:01:12.43919.7144833.334171747744833.33416145838.08
2208:01:12.57819.9744833.334173356544833.334162106514.28
2308:01:12.67616.0844833.334174490744833.334162604217.67
2408:01:12.72321.1344833.334175034744833.33416318297.48
2508:01:12.78615.7444833.334175763944833.33416425939.55
2608:01:12.83020.7044833.334176273144833.33416506948.72
2708:01:35.98610.0244833.334444282444833.334165706014.68
2808:01:36.03121.3844833.334444803244833.334166215311.84
2908:01:36.07116.6944833.334445266244833.334166840317.96
3008:01:36.13914.5644833.334446053244833.334167488417.88
3108:01:36.17826.2044833.334446504644833.334167986117.49
3208:01:36.24527.2244833.334447280144833.334168472218.81
3308:01:36.29229.4144833.334447824144833.334168935221.36
3408:01:36.33121.1044833.334448275544833.334169421314.21
3508:01:36.37727.3144833.334448807944833.334169907419.54
3608:01:36.41532.6444833.334449247744833.334170520819.93
3708:01:36.47328.1344833.334449919044833.334171122719.61
3808:01:36.52337.9744833.334450497744833.334171747719.71
3908:01:36.56629.5244833.334450995444833.334173356519.97
4008:01:36.70737.9744833.334452627344833.334174490716.08
4108:02:07.4145.8544833.334808032444833.334175034721.13
4208:02:07.46113.7344833.334808576444833.334175763915.74
4308:02:07.50910.6644833.334809131944833.334176273120.70
4408:02:07.59412.2244833.334810115744833.334444282410.02
4508:02:07.64215.2144833.334810671344833.334444803221.38
4608:02:07.69113.5644833.334811238444833.334445266216.69
4708:02:07.7698.2144833.334812141244833.334446053214.56
4808:02:07.9187.0544833.334813865744833.334446504626.20
4908:02:07.9658.7144833.334814409744833.334447280127.22
5008:02:08.02510.6944833.334815104244833.334447824129.41
5108:02:08.10316.1744833.334816006944833.334448275521.10
5208:02:08.14513.2344833.334816493144833.334448807927.31
5308:02:08.19716.6144833.334817094944833.334449247732.64
5408:02:08.23916.4744833.334817581044833.334449919028.13
5508:02:08.30115.9644833.334818298644833.334450497737.97
5608:02:08.34516.0144833.334818807944833.334450995429.52
5708:02:08.40218.2344833.334819467644833.334452627337.97
5808:02:08.45518.6144833.334820081044833.33480803245.85
5908:02:08.51718.2744833.334820798644833.334808576413.73
6008:02:08.55818.7444833.334821273244833.334809131910.66
6108:02:08.60018.8544833.334821759344833.334810115712.22
6208:02:08.64819.3044833.334822314844833.334810671315.21
6308:02:08.69018.8944833.334822800944833.334811238413.56
6408:02:08.73119.5144833.334823275544833.33481214128.21
6508:02:08.77419.4744833.334823773144833.33481386577.05
6608:02:08.81619.3744833.334824259344833.33481440978.71
6708:02:08.87419.8544833.334824930644833.334815104210.69
6808:02:08.91819.9344833.334825439844833.334816006916.17
6908:02:09.03020.5144833.334826736144833.334816493113.23
7008:02:09.07120.1344833.334827210744833.334817094916.61
7108:02:09.12620.2544833.334827847244833.334817581016.47
7208:02:09.19912.3544833.334828692144833.334818298615.96
7308:02:52.96419.8044833.335335231544833.334818807916.01
7408:02:53.02412.3544833.335335925944833.334819467618.23
7508:02:53.28421.1644833.335338935244833.334820081018.61
7608:02:53.33120.0544833.335339479244833.334820798618.27
7708:02:53.39014.7744833.335340162044833.334821273218.74
7808:02:53.45920.2544833.335340960644833.334821759318.85
7908:02:53.51619.9044833.335341620444833.334822314819.30
8008:02:53.58315.3844833.335342395844833.334822800918.89
8108:02:53.66718.5744833.335343368144833.334823275519.51
8208:02:53.71115.2844833.335343877344833.334823773119.47
8308:02:53.75218.2944833.335344351944833.334824259319.37
8408:02:53.79416.9944833.335344838044833.334824930619.85
8508:02:53.83715.3244833.335345335644833.334825439819.93
8608:02:53.88312.2844833.335345868144833.334826736120.51
8708:02:53.9318.6344833.335346423644833.334827210720.13
8808:02:54.01710.4144833.335347419044833.334827847220.25
8908:02:54.0986.0244833.335348356544833.334828692112.35
9008:02:54.17113.8944833.335349201444833.335335231519.80
9108:02:54.2218.1344833.335349780144833.335335925912.35
9208:02:54.28211.2944833.335350486144833.335338935221.16
9308:02:54.3346.4544833.335351088044833.335339479220.05
9408:03:02.96021.2244833.335450925944833.335340162014.77
9508:03:03.18120.7044833.335453483844833.335340960620.25
9608:03:03.23520.9744833.335454108844833.335341620419.90
9708:03:03.27621.0244833.335454583344833.335342395815.38
9808:03:03.32120.3044833.335455104244833.335343368118.57
9908:03:03.37820.3544833.335455763944833.335343877315.28
10008:03:03.43420.4144833.335456412044833.335344351918.29
10108:03:03.47619.7544833.335456898144833.335344838016.99
10208:03:03.52017.6344833.335457407444833.335345335615.32
10308:03:03.56414.2644833.335457916744833.335345868112.28
10408:03:03.62116.0344833.335458576444833.33534642368.63
10508:03:03.66315.9644833.335459062544833.335347419010.41
10608:03:03.71715.6144833.335459687544833.33534835656.02
10708:03:03.77416.0144833.335460347244833.335349201413.89
10808:03:03.81910.6044833.335460868144833.33534978018.13
10908:03:03.86112.9944833.335461354244833.335350486111.29
11008:03:03.9089.3444833.335461898144833.33535108806.45
11108:03:03.9656.5444833.335462557944833.335450925921.22
11208:03:04.02817.3844833.335463287044833.335453483820.70
11308:03:04.08519.2344833.335463946844833.335454108820.97
11408:03:04.13112.7544833.335464479244833.335454583321.02
11508:03:04.17713.9544833.335465011644833.335455104220.30
11608:03:04.22113.6244833.335465520844833.335455763920.35
11708:03:04.2756.8344833.335466145844833.335456412020.41
11808:03:12.9225.8544833.335566226944833.335456898119.75
11908:03:12.9768.7344833.335566851844833.335457407417.63
12008:03:13.0289.2444833.335567453744833.335457916714.26
12108:03:13.07612.2844833.335568009344833.335458576416.03
12208:03:13.12513.7344833.335568576444833.335459062515.96
12308:03:13.1837.4744833.335569247744833.335459687515.61
12408:03:13.3697.9944833.335571400544833.335460347216.01
12508:03:13.41810.0944833.335571967644833.335460868110.60
12608:03:13.4896.4144833.335572789444833.335461354212.99
12708:03:13.53313.0444833.335573298644833.33546189819.34
12808:03:13.60012.3044833.335574074144833.33546255796.54
12908:03:13.64712.5444833.335574618144833.335463287017.38
13008:03:13.69810.2044833.335575208344833.335463946819.23
13108:03:13.74212.8344833.335575717644833.335464479212.75
13208:03:13.79711.4144833.335576354244833.335465011613.95
13308:03:13.88814.0544833.335577407444833.335465520813.62
13408:03:13.93214.0444833.335577916744833.33546614586.83
13508:03:13.99014.2244833.335578588044833.33556622695.85
13608:03:14.05214.5344833.335579305644833.33556685188.73
13708:03:14.14714.7144833.335580405144833.33556745379.24
13808:03:14.19315.1944833.335580937544833.335568009312.28
13908:03:14.26915.5044833.335581817144833.335568576413.73
14008:03:14.38215.4744833.335583125044833.33556924777.47
14108:03:14.51215.4944833.335584629644833.33557140057.99
14208:03:14.60515.4944833.335585706044833.335571967610.09
14308:03:14.74115.3444833.335587280144833.33557278946.41
14408:03:34.8036.8344833.335819479244833.335573298613.04
14508:03:34.86010.1444833.335820138944833.335574074112.30
14608:03:34.92112.4644833.335820844944833.335574618112.54
14708:03:34.9897.3944833.335821631944833.335575208310.20
14808:03:35.0378.4344833.335822187544833.335575717612.83
14908:03:35.1397.4444833.335823368144833.335576354211.41
15008:03:35.1868.9144833.335823912044833.335577407414.05
15108:03:35.23110.5444833.335824432944833.335577916714.04
15208:03:35.29115.4344833.335825127344833.335578588014.22
15308:03:35.33413.7544833.335825625044833.335579305614.53
15408:03:35.37515.7844833.335826099544833.335580405114.71
15508:03:35.41813.9544833.335826597244833.335580937515.19
15608:03:35.49515.2844833.335827488444833.335581817115.50
15708:03:35.55420.5944833.335828171344833.335583125015.47
15808:03:35.60420.1044833.335828750044833.335584629615.49
15908:03:35.66720.7544833.335829479244833.335585706015.49
16008:03:35.71921.5044833.335830081044833.335587280115.34
16108:03:35.79721.5644833.335830983844833.33581947926.83
16208:03:35.84221.7344833.335831504644833.335820138910.14
16308:03:35.88921.6744833.335832048644833.335820844912.46
16408:03:36.00722.3444833.335833414444833.33582163197.39
16508:03:36.04721.9744833.335833877344833.33582218758.43
16608:03:36.12022.5644833.335834722244833.33582336817.44
16708:03:36.22722.5644833.335835960644833.33582391208.91
16808:04:10.65023.4844833.336234375044833.335824432910.54
16908:04:10.69817.1044833.336234930644833.335825127315.43
17008:04:10.73822.0044833.336235393544833.335825625013.75
17108:04:10.79421.8244833.336236041744833.335826099515.78
17208:04:10.85920.3544833.336236794044833.335826597213.95
17308:04:10.91820.4344833.336237476844833.335827488415.28
17408:04:10.97218.9244833.336238101944833.335828171320.59
17508:04:11.01518.9844833.336238599544833.335828750020.10
17608:04:11.05720.5644833.336239085644833.335829479220.75
17708:04:11.10919.8544833.336239687544833.335830081021.50
Sheet1
Cell Formulas
RangeFormula
C3:C177C3=A3
 

Attachments

  • Screenshot 2022-09-30 at 07.52.30 Medium.jpeg
    Screenshot 2022-09-30 at 07.52.30 Medium.jpeg
    60.5 KB · Views: 27
Hi @cmowla and @gifariz
I hope you could help further with 2 further functions I'd like to to achieve, 1 of which I've made progress on but not solved it yet.

1. Find the corresponding time to the highest speed in a cluster. I made some progress with Offset Index Match, but this returns the time of the first occurrence of the max speed. In my sample data here, Vcluster 6 shows the time where speed 23.04 appeared first in the Speed column (F19), rather than the corresponding time at E178

2. Very occasionally there are anomalous reading logged in the data, eg Vcluster 4 shows 65.21 (F157) which is way above the other speed logs in that Vcluster. I need a function which filters outliers like these where the value varies greatly from the average within the cluster (24.91 in this case), or its 'gap' from the others is significantly more.

Any pointers very gratefully received.
VclusterClusterMaxTimeClusterMaxSpunixepochhh:mm:ss.000SpeedGapCluster
015:40:54.49533.46166524005290915:40:52.9097.17
015:40:54.49533.46166524005322515:40:53.22521.563160
115:40:58.68327.41166524005328815:40:53.28824.44630
215:41:23.93341.93166524005376215:40:53.76211.374740
315:41:31.82744.36166524005383115:40:53.83118.25690
415:41:38.47365.21166524005388715:40:53.8876.74560
515:41:58.05948.67166524005400915:40:54.00912.461220
615:40:54.75323.04166524005405715:40:54.05717.19480
166524005409515:40:54.09524.48380
166524005413515:40:54.13526.50400
166524005424915:40:54.24929.201140
166524005430615:40:54.30630.30570
166524005449515:40:54.49533.461890
166524005456115:40:54.56132.06660
166524005459515:40:54.59533.25340
166524005466015:40:54.66025.21650
166524005470515:40:54.70533.32450
166524005475315:40:54.75323.04480
166524005484315:40:54.84333.18900
166524005803215:40:58.0325.8231891
166524005807115:40:58.07116.44391
166524005812415:40:58.12413.39531
166524005818915:40:58.1899.24651
166524005824415:40:58.2445.99551
166524005829015:40:58.2909.22461
166524005834515:40:58.34525.86551
166524005839415:40:58.39419.49491
166524005843315:40:58.43316.98391
166524005848215:40:58.48212.65491
166524005856215:40:58.56224.63801
166524005861515:40:58.61519.85531
166524005868315:40:58.68327.41681
166524005882115:40:58.82120.151381
166524007038415:41:10.38410.50115632
166524007042415:41:10.42415.73402
166524007046515:41:10.46524.82412
166524007050215:41:10.50229.63372
166524007058115:41:10.58136.92792
166524007064915:41:10.64912.16682
166524007073315:41:10.73326.28842
166524007077715:41:10.77737.97442
166524007086215:41:10.86237.26852
166524007092815:41:10.92836.83662
166524007234115:41:12.34117.9614132
166524007242115:41:12.42111.88802
166524007247415:41:12.4747.63532
166524007253815:41:12.53819.33642
166524007257815:41:12.57827.36402
166524007270915:41:12.70915.641312
166524007275015:41:12.75018.72412
166524007279815:41:12.79821.24482
166524007284615:41:12.84623.76482
166524007288415:41:12.88429.58382
166524007292415:41:12.92422.43402
166524007296115:41:12.96124.75372
166524007300915:41:13.00934.39482
166524007305015:41:13.05036.17412
166524007314415:41:13.14434.46942
166524007364015:41:13.64026.284962
166524007504215:41:15.0429.3014022
166524007508115:41:15.08116.85392
166524007518615:41:15.18615.191052
166524007524315:41:15.24316.85572
166524007528315:41:15.28319.23402
166524007532615:41:15.32627.17432
166524007536815:41:15.36824.33422
166524007541715:41:15.41735.37492
166524007550715:41:15.50735.69902
166524007556815:41:15.56837.79612
166524007571915:41:15.71929.041512
166524007862415:41:18.6246.6529052
166524007866715:41:18.66712.02432
166524007880415:41:18.8049.541372
166524007884315:41:18.84322.27392
166524007898015:41:18.98029.521372
166524007911415:41:19.11436.921342
166524007921915:41:19.21937.791052
166524007938515:41:19.38538.701662
166524007944215:41:19.44238.51572
166524007950115:41:19.50139.56592
166524008081215:41:20.81217.1413112
166524008095615:41:20.95626.331442
166524008102515:41:21.02517.16692
166524008109015:41:21.09011.08652
166524008125215:41:21.25215.731622
166524008130615:41:21.30614.31542
166524008136315:41:21.36325.37572
166524008145415:41:21.4546.02912
166524008150115:41:21.5018.34472
166524008155515:41:21.55525.25542
166524008159515:41:21.59532.71402
166524008163515:41:21.63530.94402
166524008168315:41:21.68333.32482
166524008173115:41:21.73135.69482
166524008180315:41:21.80335.45722
166524008201215:41:22.01217.462092
166524008204915:41:22.04939.27372
166524008282315:41:22.8236.807742
166524008291515:41:22.9158.51922
166524008295815:41:22.95811.22432
166524008299915:41:22.99924.90412
166524008304715:41:23.04721.05482
166524008309515:41:23.09514.34482
166524008313615:41:23.13613.37412
166524008317515:41:23.17520.54392
166524008321315:41:23.21328.47382
166524008326115:41:23.26130.71482
166524008330115:41:23.30123.24402
166524008335115:41:23.35138.89502
166524008341715:41:23.41737.26662
166524008353415:41:23.53424.331172
166524008366415:41:23.66440.251302
166524008381115:41:23.81141.501472
166524008387215:41:23.87240.86612
166524008393315:41:23.93341.93612
166524008398615:41:23.98640.76532
166524008494315:41:24.94315.179572
166524008500615:41:25.00624.71632
166524008506715:41:25.06712.84612
166524008511515:41:25.11528.83482
166524008519015:41:25.19030.13752
166524008522815:41:25.22818.38382
166524008529215:41:25.29211.36642
166524009136815:41:31.36821.7360763
166524009140815:41:31.40816.98403
166524009147615:41:31.47631.43683
166524009178115:41:31.78141.823053
166524009182715:41:31.82744.36463
166524009623815:41:36.23810.2444114
166524009628015:41:36.28018.31424
166524009642215:41:36.42215.171424
166524009646415:41:36.46416.29424
166524009651115:41:36.51120.62474
166524009656115:41:36.56125.41504
166524009661415:41:36.61431.61534
166524009668315:41:36.68334.54694
166524009676315:41:36.76335.07804
166524009679815:41:36.79834.99354
166524009770115:41:37.70113.989034
166524009776215:41:37.7628.25614
166524009780115:41:37.80115.78394
166524009784015:41:37.84022.88394
166524009791915:41:37.91910.52794
166524009796515:41:37.9659.47464
166524009800615:41:38.00621.30414
166524009804415:41:38.04427.22384
166524009808215:41:38.08230.36384
166524009811815:41:38.11827.59364
166524009815615:41:38.15633.46384
166524009819815:41:38.19833.88424
166524009825115:41:38.25133.25534
166524009829815:41:38.29836.50474
166524009833215:41:38.33236.67344
166524009839715:41:38.39737.35654
166524009843315:41:38.43337.97364
166524009847315:41:38.47365.21404
166524009854415:41:38.54437.00714
166524009863015:41:38.63037.35864
166524010126915:41:41.26916.9826394
166524010132315:41:41.3235.87544
166524010137015:41:41.3708.76474
166524010141815:41:41.41831.49484
166524010146115:41:41.46122.78434
166524010153415:41:41.53414.46734
166524010157215:41:41.57218.83384
166524010231415:41:42.31427.177424
166524010465715:41:44.6576.9923434
166524011781515:41:57.8159.77131585
166524011788215:41:57.88231.61675
166524011805915:41:58.05948.671775
166524012406515:42:04.06511.9060066
166524012411915:42:04.11915.85546
166524012420715:42:04.20710.69886
166524012425115:42:04.25111.91446
166524012430815:42:04.30820.10576
166524012437015:42:04.3709.82626
166524012441915:42:04.41923.04496
166524012649615:42:06.4968.1620776
166524012655515:42:06.5555.96596
166524012664715:42:06.64716.61926
166524012672215:42:06.72223.04756
 
Last edited:
Upvote 0

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
I've now solved point 1 with a slightly more crude way by simply taking the max time in a vCluster.
 
Upvote 0
Hi @cmowla and @gifariz
I hope you could help further with 2 further functions I'd like to to achieve, 1 of which I've made progress on but not solved it yet.

1. Find the corresponding time to the highest speed in a cluster. I made some progress with Offset Index Match, but this returns the time of the first occurrence of the max speed. In my sample data here, Vcluster 6 shows the time where speed 23.04 appeared first in the Speed column (F19), rather than the corresponding time at E178

2. Very occasionally there are anomalous reading logged in the data, eg Vcluster 4 shows 65.21 (F157) which is way above the other speed logs in that Vcluster. I need a function which filters outliers like these where the value varies greatly from the average within the cluster (24.91 in this case), or its 'gap' from the others is significantly more.

Any pointers very gratefully received.

1. I'm not sure why you take max time in a cluster. I think corresponding time can be obtained by making a helper column that contains both cluster & speed data.
For example in cell I2, =H2&"_"&F2, and so on for all data. Then index match to this helper column, B2=INDEX(E:E,MATCH(A2&"_"&C2,I:I,0)).

2. This is tricky because again the outlier limit is not well defined. One that I can think of is to compare each speed relatively with average (or with standard deviation also) of speed in that cluster. And filter the data within acceptable ratio. For example set Limit=2. Then FilteredSpeed = IF(AND(Speed/ClusterAvgSpeed>(1/Limit),Speed/ClusterAvgSpeed<Limit),Speed,NA()). Then use this filtered speed column as basic data for further data processing. Hope you understand as I haven't had time to make the excel.
 
Upvote 0
1. I'm not sure why you take max time in a cluster. I think corresponding time can be obtained by making a helper column that contains both cluster & speed data.
For example in cell I2, =H2&"_"&F2, and so on for all data. Then index match to this helper column, B2=INDEX(E:E,MATCH(A2&"_"&C2,I:I,0)).

2. This is tricky because again the outlier limit is not well defined. One that I can think of is to compare each speed relatively with average (or with standard deviation also) of speed in that cluster. And filter the data within acceptable ratio. For example set Limit=2. Then FilteredSpeed = IF(AND(Speed/ClusterAvgSpeed>(1/Limit),Speed/ClusterAvgSpeed<Limit),Speed,NA()). Then use this filtered speed column as basic data for further data processing. Hope you understand as I haven't had time to make the excel.
This is great, thank you. Item 1 makes perfect sense. I will explore your suggestion for item 2.

I really appreciate your expertise 🙏
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,323
Members
452,635
Latest member
laura12345

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