GET MAX TIME VALUES BETWEEN TWO RANGES IN EXCEL LIST

AFZAL SOHAIL

Board Regular
Joined
May 31, 2023
Messages
146
Office Version
  1. 2021
  2. 2016
Platform
  1. Windows
Dear Time:-
I am sharing the list of Time value I need the max time value between two ranges:-
1. 08:00 to 09:45
2.10:00 to 14:45
3.15:00 to 18:45
I will be thankful to you
I need this formula in coloumn B:-
DurationDuration
4 hr. 45 min.4:45
1 hr. 41 min.1:41
2 hr. 55 min.2:55
8 hr. 58 min.8:58
4 hr. 59 min.4:59
5 hr. 31 min.5:31
7 hr. 06 min.7:06
11 hr. 04 min.11:04
6 hr. 48 min.6:48
14 hr. 20 min.14:20
5 hr. 29 min.5:29
1 hr. 45 min.1:45
25 hr. 07 min.25:07
3 hr. 15 min.3:15
 
The two formulas above will get the results:

COUNTIF formula will give you how many results fall with in the time ranges.

MAXIFS formula will give you the maximum for the time ranges.
 
Upvote 0

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Sir, you are right,
I want to know the entries of these ranges, for example b5 has the 08-0900 ranges,
b9 and b11 has the results of 10-14.45
I think you understand my querry.
 
Upvote 0
I believe the FILTER function would give you this.

=FILTER(range, (criteria_range1 = criteria1) * (criteria_range2 = criteria2))

=FILTER(B:B, (A:A >= TIME(8,0,0)) * (A:A <= TIME(9,0,0)))
 
Upvote 0
Sir, I check the formula as you give me but it is giving the same values as colomn B, like this
=FILTER(B:B, (A:A >= TIME(8,0,0)) * (A:A <= TIME(9,0,0)))

Duration​
Duration​
4 hr. 45 min.​
04:45​
1 hr. 41 min.​
01:41​
2 hr. 55 min.​
02:55​
8 hr. 58 min.​
08:58​
4 hr. 59 min.​
04:59​
5 hr. 31 min.​
05:31​
7 hr. 06 min.​
07:06​
11 hr. 04 min.​
11:04​
6 hr. 48 min.​
06:48​
14 hr. 20 min.​
14:20​
5 hr. 29 min.​
05:29​
1 hr. 45 min.​
01:45​
25 hr. 07 min.​
25:07:00​
3 hr. 15 min.​
03:15​

And when I use the formula like as:-
=FILTER(B:B, (b:b >= TIME(8,0,0)) * (b:b <= TIME(9,0,0)))
It gives the values is as under:-

08:58​
11:04​
14:20​
01:07​
 
Upvote 0
To get the maximum within the range you need to use:

Excel Formula:
=MAXIFS(A2:A15, A2:A15, ">="&TIME(8,0,0), A2:A15, "<="&TIME(9,0,0))
 
Upvote 0
Sir,you already share this formula, i want to find out the cells also which have these values.
 
Upvote 0
Ok if you want to get the cell value of the maximum value then try.

Excel Formula:
=ADDRESS(MATCH(MAXIFS(A2:A15, A2:A15, ">="&TIME(8,0,0), A2:A15, "<="&TIME(9,0,0)), A2:A15, 0) + ROW(A2:A15) - 1, COLUMN(A2), 4)

Is this what you want?
 
Upvote 0
I want like this but the result is n/a as shown it down:
DurationDuration
4 hr. 45 min.04:45
#N/A​
1 hr. 41 min.01:41
#N/A​
2 hr. 55 min.02:55
#N/A​
8 hr. 58 min.08:58
#N/A​
4 hr. 59 min.04:59
#N/A​
5 hr. 31 min.05:31
#N/A​
7 hr. 06 min.07:06
#N/A​
11 hr. 04 min.11:04
#N/A​
6 hr. 48 min.06:48
#N/A​
14 hr. 20 min.14:20
#N/A​
5 hr. 29 min.05:29
#N/A​
1 hr. 45 min.01:45
#N/A​
25 hr. 07 min.25:07:00
#N/A​
3 hr. 15 min.03:15
#N/A​
 
Upvote 0
This formula will get you the maximum from the range.
Excel Formula:
=MAX(IF((A1:A100>=TIME(8,0,0))*(A1:A100<=TIME(9,0,0)), A1:A100))

1703224240275.png


and this formula will give the cell address.
Excel Formula:
=ADDRESS(MATCH(MAX(IF((A1:A100>=TIME(8,0,0))*(A1:A100<=TIME(9,0,0)), A1:A100)), A1:A100, 0), 1)

1703224284716.png
 
Upvote 0

Forum statistics

Threads
1,223,164
Messages
6,170,444
Members
452,326
Latest member
johnshaji

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