Formula to identify the time & frequency of max value.

Sindhura

New Member
Joined
Oct 7, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi,


Need some help to identify the latest time when max value is reached and how many times that max value has been reached in that particular day.

Brief example for my question:

the max value for 1st Nov is 12 and the peak usage latest time is 1600
and 12 has reached 8 times in that particular day.

Date & Time​
Max​
Total​
11/1/2023 0:00​
1​
50​
11/1/2023 1:00​
3​
50​
11/1/2023 2:00​
3​
50​
11/1/2023 3:00​
3​
50​
11/1/2023 4:00​
12​
50​
11/1/2023 5:00​
12​
50​
11/1/2023 6:00​
12​
50​
11/1/2023 7:00​
12​
50​
11/1/2023 8:00​
12​
50​
11/1/2023 9:00​
12​
50​
11/1/2023 10:00​
12​
50​
11/1/2023 11:00​
4​
50​
11/1/2023 12:00​
7​
50​
11/1/2023 13:00​
6​
50​
11/1/2023 14:00​
7​
50​
11/1/2023 15:00​
8​
50​
11/1/2023 16:00​
12​
50​
11/1/2023 17:00​
9​
50​
11/1/2023 18:00​
4​
50​
11/1/2023 19:00​
4​
50​
11/1/2023 20:00​
4​
50​
11/1/2023 21:00​
4​
50​
11/1/2023 22:00​
4​
50​
11/1/2023 23:00​
4​
50​
11/2/2023 0:00​
4​
50​
11/2/2023 1:00​
4​
50​
11/2/2023 2:00​
4​
50​
11/2/2023 3:00​
4​
50​
11/2/2023 4:00​
5​
50​
11/2/2023 5:00​
5​
50​
11/2/2023 6:00​
5​
50​
11/2/2023 7:00​
7​
50​
11/2/2023 8:00​
13​
50​
11/2/2023 9:00​
12​
50​
11/2/2023 10:00​
15​
50​
11/2/2023 11:00​
14​
50​
11/2/2023 12:00​
15​
50​
11/2/2023 13:00​
17​
50​
11/2/2023 14:00​
19​
50​
11/2/2023 15:00​
17​
50​
11/2/2023 16:00​
13​
50​
11/2/2023 17:00​
10​
50​
11/2/2023 18:00​
6​
50​
11/2/2023 19:00​
5​
50​
11/2/2023 20:00​
6​
50​
11/2/2023 21:00​
6​
50​
11/2/2023 22:00​
6​
50​
11/2/2023 23:00​
5​
50​


Output should be like:
Date​
Peak usage latest time​
Frequency (max value)​
11/1/2023​
1600​
8​
11/2/2023​
1400​
1​


Thank you in advance!
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Try if this could work for you (columns A - B - C represent Date & Time - Max - Total):

List of days:

Excel Formula:
=UNIQUE(INT(A2:A49))

Peak max time for a particular day:

Excel Formula:
=LET(
day,FILTER($A$2:$B$49,INT($A$2:$A$49)=E2),
max,MAX(CHOOSECOLS(day,2)),
MOD(TAKE(SORT(FILTER(CHOOSECOLS(day,1),CHOOSECOLS(day,2)=max)),-1),1))

where E2 is the day to be calculated, e.g. 11/1/2023.

Frequency of max value for a particular day:

Excel Formula:
=LET(
day,FILTER($A$2:$B$49,INT($A$2:$A$49)=E2),
max,MAX(CHOOSECOLS(day,2)),
ROWS(FILTER(CHOOSECOLS(day,1),CHOOSECOLS(day,2)=max)))

where E2 is the day to be calculated, e.g. 11/1/2023.
 
Upvote 0
try this:
Book1
ABCDEFGH
1Date & TimeMaxTotal
22023-11-01 00:00:00150DatePeak usage latest timeFrequency (max value)
32023-11-01 01:00:0035011/1/202316008
42023-11-01 02:00:0035011/2/202314001
52023-11-01 03:00:00350
62023-11-01 04:00:001250
72023-11-01 05:00:0012502023-11-0116:00:008
82023-11-01 06:00:0012502023-11-0214:00:001
92023-11-01 07:00:001250
102023-11-01 08:00:001250
112023-11-01 09:00:001250
122023-11-01 10:00:001250
132023-11-01 11:00:00450
142023-11-01 12:00:00750
152023-11-01 13:00:00650
162023-11-01 14:00:00750
172023-11-01 15:00:00850
182023-11-01 16:00:001250
192023-11-01 17:00:00950
202023-11-01 18:00:00450
212023-11-01 19:00:00450
222023-11-01 20:00:00450
232023-11-01 21:00:00450
242023-11-01 22:00:00450
252023-11-01 23:00:00450
262023-11-02 00:00:00450
272023-11-02 01:00:00450
282023-11-02 02:00:00450
292023-11-02 03:00:00450
302023-11-02 04:00:00550
312023-11-02 05:00:00550
322023-11-02 06:00:00550
332023-11-02 07:00:00750
342023-11-02 08:00:001350
352023-11-02 09:00:001250
362023-11-02 10:00:001550
372023-11-02 11:00:001450
382023-11-02 12:00:001550
392023-11-02 13:00:001750
402023-11-02 14:00:001950
412023-11-02 15:00:001750
422023-11-02 16:00:001350
432023-11-02 17:00:001050
442023-11-02 18:00:00650
452023-11-02 19:00:00550
462023-11-02 20:00:00650
472023-11-02 21:00:00650
482023-11-02 22:00:00650
492023-11-02 23:00:00550
50
Sheet2
Cell Formulas
RangeFormula
G7:G8G7=LET(ds,INT($A$2:$A$49),d,$F7,mx,$B$2:$B$49,dmx,MAX(FILTER(mx,ds=d,"")), INDEX(MOD($A$2:$A$49,1),MAX((mx=dmx)*(ROW(mx)-1)*(ds=d))))
H7:H8H7=LET(ds,INT($A$2:$A$49),d,$F7,mx,$B$2:$B$49,fmx,MAX(FILTER(mx,ds=d,"")), SUM((ds=d)*(fmx=mx)))
 
Upvote 0
Another option
Fluff.xlsm
ABCDEFG
1Date & TimeMaxTotal
201/11/2023 00:0015001/11/202316:00:008
301/11/2023 01:0035002/11/202314:00:001
401/11/2023 02:00350
501/11/2023 03:00350
601/11/2023 04:001250
701/11/2023 05:001250
801/11/2023 06:001250
901/11/2023 07:001250
1001/11/2023 08:001250
1101/11/2023 09:001250
1201/11/2023 10:001250
1301/11/2023 11:00450
1401/11/2023 12:00750
1501/11/2023 13:00650
1601/11/2023 14:00750
1701/11/2023 15:00850
1801/11/2023 16:001250
1901/11/2023 17:00950
2001/11/2023 18:00450
2101/11/2023 19:00450
2201/11/2023 20:00450
2301/11/2023 21:00450
2401/11/2023 22:00450
2501/11/2023 23:00450
2602/11/2023 00:00450
2702/11/2023 01:00450
2802/11/2023 02:00450
2902/11/2023 03:00450
3002/11/2023 04:00550
3102/11/2023 05:00550
3202/11/2023 06:00550
3302/11/2023 07:00750
3402/11/2023 08:001350
3502/11/2023 09:001250
3602/11/2023 10:001550
3702/11/2023 11:001450
3802/11/2023 12:001550
3902/11/2023 13:001750
4002/11/2023 14:001950
4102/11/2023 15:001750
4202/11/2023 16:001350
4302/11/2023 17:001050
4402/11/2023 18:00650
4502/11/2023 19:00550
4602/11/2023 20:00650
4702/11/2023 21:00650
4802/11/2023 22:00650
4902/11/2023 23:00550
Data
Cell Formulas
RangeFormula
E2:E3E2=UNIQUE(FILTER(INT(A2:A100),A2:A100<>""))
F2:G3F2=LET(a,SORT(FILTER($A$2:$B$100,INT(A2:A100)=E2),{2,1},-1),HSTACK(TAKE(a,1,1),SUM(IF(INDEX(a,,2)=MAX(INDEX(a,,2)),1,0))))
Dynamic array formulas.
 
Upvote 0
try this:
Book1
ABCDEFGH
1Date & TimeMaxTotal
22023-11-01 00:00:00150DatePeak usage latest timeFrequency (max value)
32023-11-01 01:00:0035011/1/202316008
42023-11-01 02:00:0035011/2/202314001
52023-11-01 03:00:00350
62023-11-01 04:00:001250
72023-11-01 05:00:0012502023-11-0116:00:008
82023-11-01 06:00:0012502023-11-0214:00:001
92023-11-01 07:00:001250
102023-11-01 08:00:001250
112023-11-01 09:00:001250
122023-11-01 10:00:001250
132023-11-01 11:00:00450
142023-11-01 12:00:00750
152023-11-01 13:00:00650
162023-11-01 14:00:00750
172023-11-01 15:00:00850
182023-11-01 16:00:001250
192023-11-01 17:00:00950
202023-11-01 18:00:00450
212023-11-01 19:00:00450
222023-11-01 20:00:00450
232023-11-01 21:00:00450
242023-11-01 22:00:00450
252023-11-01 23:00:00450
262023-11-02 00:00:00450
272023-11-02 01:00:00450
282023-11-02 02:00:00450
292023-11-02 03:00:00450
302023-11-02 04:00:00550
312023-11-02 05:00:00550
322023-11-02 06:00:00550
332023-11-02 07:00:00750
342023-11-02 08:00:001350
352023-11-02 09:00:001250
362023-11-02 10:00:001550
372023-11-02 11:00:001450
382023-11-02 12:00:001550
392023-11-02 13:00:001750
402023-11-02 14:00:001950
412023-11-02 15:00:001750
422023-11-02 16:00:001350
432023-11-02 17:00:001050
442023-11-02 18:00:00650
452023-11-02 19:00:00550
462023-11-02 20:00:00650
472023-11-02 21:00:00650
482023-11-02 22:00:00650
492023-11-02 23:00:00550
50
Sheet2
Cell Formulas
RangeFormula
G7:G8G7=LET(ds,INT($A$2:$A$49),d,$F7,mx,$B$2:$B$49,dmx,MAX(FILTER(mx,ds=d,"")), INDEX(MOD($A$2:$A$49,1),MAX((mx=dmx)*(ROW(mx)-1)*(ds=d))))
H7:H8H7=LET(ds,INT($A$2:$A$49),d,$F7,mx,$B$2:$B$49,fmx,MAX(FILTER(mx,ds=d,"")), SUM((ds=d)*(fmx=mx)))
Its Working!!!
Saves so much time! Thank you so much
 
Upvote 0
Adding one more to the mix.
Book1
ABCDEFG
1Date & TimeMaxTotalDatePeak usage latest timeFrequency (max value)
211/1/23 0:0015011/1/2316:008
311/1/23 1:0035011/2/2314:001
411/1/23 2:00350
511/1/23 3:00350
611/1/23 4:001250
711/1/23 5:001250
811/1/23 6:001250
911/1/23 7:001250
1011/1/23 8:001250
1111/1/23 9:001250
1211/1/23 10:001250
1311/1/23 11:00450
1411/1/23 12:00750
1511/1/23 13:00650
1611/1/23 14:00750
1711/1/23 15:00850
1811/1/23 16:001250
1911/1/23 17:00950
2011/1/23 18:00450
2111/1/23 19:00450
2211/1/23 20:00450
2311/1/23 21:00450
2411/1/23 22:00450
2511/1/23 23:00450
2611/2/23 0:00450
2711/2/23 1:00450
2811/2/23 2:00450
2911/2/23 3:00450
3011/2/23 4:00550
3111/2/23 5:00550
3211/2/23 6:00550
3311/2/23 7:00750
3411/2/23 8:001350
3511/2/23 9:001250
3611/2/23 10:001550
3711/2/23 11:001450
3811/2/23 12:001550
3911/2/23 13:001750
4011/2/23 14:001950
4111/2/23 15:001750
4211/2/23 16:001350
4311/2/23 17:001050
4411/2/23 18:00650
4511/2/23 19:00550
4611/2/23 20:00650
4711/2/23 21:00650
4811/2/23 22:00650
4911/2/23 23:00550
Sheet1
Cell Formulas
RangeFormula
E2:E3E2=UNIQUE(INT(A2:A49))
F2:G3F2=LET(d,$A$2:$A$49,a,INT(d)=E2,b,$B$2:$B$49,k,a*(b=MAX(IF(a,b))),HSTACK(XLOOKUP(1,k,MOD(d,1),,,-1),SUM(k)))
Dynamic array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,813
Messages
6,181,111
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