Pick the first value from a range of data which is more than X value

gnaga

Well-known Member
Joined
Jul 9, 2002
Messages
748
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Book1
EFGHI
6
710:00:00 AM
8
9
10
11
1210:00:00 AM
1310:06:00 AM
1410:06:00 AM
1510:12:00 AM
1610:12:00 AM
1710:18:00 AM
1810:18:00 AM
1910:24:00 AM
2010:24:00 AM
2110:27:00 AM 
2210:27:00 AM
2310:30:00 AM
2410:30:00 AM
2510:42:00 AM
2610:42:00 AM
2710:54:00 AM
28
29
30
31
3210:54:00 AM
3311:00:00 AM
3411:00:00 AM
3511:06:00 AM
36
Sheet1
Cell Formulas
RangeFormula
H21H21=INDEX(F8:F35,MATCH(TRUE,INDEX(F8:F35>(F7+(60/1440)),0),0))


Formula in the cell H21 returns blank cell. I wish to pick the time which is just crossing more than an hour than "F7". The correct result is "F35" should return. I am finding it difficult to get this correct. Please help.
 
Last edited:
Little starge behavior when I change the data value. Column "N" having two identical values both get formatted.
My previous formula accounted for two or more identical values (eg see your column F) but I only allowed for that in consecutive cells.
Try this formula instead

Excel Formula:
=AND(E7=AGGREGATE(15,6,E$8:E$34/(E$8:E$34>E$6+1/24),1),ISNA(MATCH(E7,E$6:E6,0)))


Moreover if you could explain your formula would be grateful.
=AND(E7=AGGREGATE(15,6,E$8:E$34/(E$8:E$34>E$6+1/24),1),ISNA(MATCH(E7,E$6:E6,0)))

For a cell to be formatted ..
- the red part says that it must equal the smallest value that is more than 1 hour after row 6 (in your latest sample N26 and N31 meet that criteria)
- the blue part says that there must be no value the same above (that rules out N31)
 
Upvote 0
Solution

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
My previous formula accounted for two or more identical values (eg see your column F) but I only allowed for that in consecutive cells.
Try this formula instead

Excel Formula:
=AND(E7=AGGREGATE(15,6,E$8:E$34/(E$8:E$34>E$6+1/24),1),ISNA(MATCH(E7,E$6:E6,0)))



=AND(E7=AGGREGATE(15,6,E$8:E$34/(E$8:E$34>E$6+1/24),1),ISNA(MATCH(E7,E$6:E6,0)))

For a cell to be formatted ..
- the red part says that it must equal the smallest value that is more than 1 hour after row 6 (in your latest sample N26 and N31 meet that criteria)
- the blue part says that there must be no value the same above (that rules out N31)
Thank you so much Peter_SSs ????. I understand the formula what it does. It may take years for me to think and build formula like this. Is there any specific approach to build the formula??
 
Upvote 0

Forum statistics

Threads
1,214,790
Messages
6,121,607
Members
449,037
Latest member
Arbind kumar

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