Excel - Ranking of date & time, rank by day

54 Views Asked by At

Please see list of date and times in cells:

List of dates and times


I would like to find the ranking of the cell's date and time according to what day it falls on.

So in this example "14/12/2023 09:06" would rank 1, "14/12/2023 13:04" would rank 2. "15/12/2023 08:59" would rank 1, "15/12/2023 13:28" would rank 2. And finally, "19/12/2023 10:49" would rank 1, "19/12/2023 13:03" would rank 2. Any ideas on how to retrieve these rankings based on the day?
Thanks in advance
3

There are 3 best solutions below

0
Harun24hr On BEST ANSWER

You may try-

=XMATCH(A1,SORT(FILTER($A$1:$A$6,($A$1:$A$6>=INT(A1)+TIME(0,0,1))*($A$1:$A$6<=INT(A1)+TIME(23,59,59)))),1)

enter image description here

0
Mayukh Bhattacharya On

Here is one way using MMULT()

enter image description here


 =LET(a, A2:A7, b, ROW(a), MMULT((b>=TOROW(b))*(INT(a)=TOROW(INT(a))),b^0))

0
Foxfire And Burns And Burns On

Because dates are integers and times are decimals, count same integers values:

=COUNTIFS($A$2:A2;">="&INT(A2);$A$2:A2;"<"&(INT(A2)+1))

enter image description here

Note this formula will work only if your data is sorted as shown in your image.