max time for date

rsj88

New Member
Joined
Feb 20, 2018
Messages
38
Hi guys i have the below table:

if i have a date in A1 i want to get the max time for that date.

Thanks

[TABLE="width: 500"]
<tbody>[TR]
[TD]date[/TD]
[TD]time[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[TD]18:45[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[TD]18:45[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[TD]18:45[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[TD]18:45[/TD]
[/TR]
[TR]
[TD]01/01/2019[/TD]
[TD]18:45[/TD]
[/TR]
[TR]
[TD]02/01/2019[/TD]
[TD]08:23[/TD]
[/TR]
[TR]
[TD]02/01/2019[/TD]
[TD]08:23[/TD]
[/TR]
[TR]
[TD]03/01/2019[/TD]
[TD]08:24[/TD]
[/TR]
[TR]
[TD]03/01/2019[/TD]
[TD]23:24[/TD]
[/TR]
</tbody>[/TABLE]

[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Hi, if you have a newer version of Excel take a look at MAXIFS(), otherwise here is one option.


Excel 2013/2016
AB
103/01/201923:24
2
3datetime
401/01/201918:45
501/01/201918:45
601/01/201918:45
701/01/201918:45
801/01/201918:45
902/01/201908:23
1002/01/201908:23
1103/01/201908:24
1203/01/201923:24
Sheet1
Cell Formulas
RangeFormula
B1=AGGREGATE(14,6,B4:B12/(A4:A12=A1),1)
 
Last edited:
Upvote 0
or

[Table="width:, class:head"]
[tr=bgcolor:#FFFFFF][td=bgcolor:#5B9BD5]date[/td][td=bgcolor:#5B9BD5]time[/td][td][/td][td=bgcolor:#70AD47]date[/td][td=bgcolor:#70AD47]time[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]
01/01/2019​
[/td][td=bgcolor:#DDEBF7]
18:45​
[/td][td][/td][td=bgcolor:#E2EFDA]
01/01/2019​
[/td][td=bgcolor:#E2EFDA]
18:45:00​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
01/01/2019​
[/td][td]
18:45​
[/td][td][/td][td]
02/01/2019​
[/td][td]
08:23:00​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]
01/01/2019​
[/td][td=bgcolor:#DDEBF7]
18:45​
[/td][td][/td][td=bgcolor:#E2EFDA]
03/01/2019​
[/td][td=bgcolor:#E2EFDA]
23:24:00​
[/td][/tr]

[tr=bgcolor:#FFFFFF][td]
01/01/2019​
[/td][td]
18:45​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]
01/01/2019​
[/td][td=bgcolor:#DDEBF7]
18:45​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
02/01/2019​
[/td][td]
08:23​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]
02/01/2019​
[/td][td=bgcolor:#DDEBF7]
08:23​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td]
03/01/2019​
[/td][td]
08:24​
[/td][td][/td][td][/td][td][/td][/tr]

[tr=bgcolor:#FFFFFF][td=bgcolor:#DDEBF7]
03/01/2019​
[/td][td=bgcolor:#DDEBF7]
23:24​
[/td][td][/td][td][/td][td][/td][/tr]
[/table]


Code:
[SIZE=1]let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"date", type date}, {"time", type time}}),
    Group = Table.Group(Type, {"date"}, {{"time", each List.Max([time]), type time}})
in
    Group[/SIZE]
 
Upvote 0

Forum statistics

Threads
1,223,910
Messages
6,175,316
Members
452,634
Latest member
cpostell

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