Unique values based on Time

Karthik23

New Member
Joined
Jul 15, 2022
Messages
15
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi ,

Can you please help me in writing a formulae for extracting uniques values based on time.
Example: If A comes to playground at 10: 00AM
B comes to playground at 10:00AM
A goes out and comes back at 10:05AM
B goes out and comes back at 10:15AM
Here if i extract names based on time i need result as A,B,0,B taking time gap as 10 min...
for every 10 min gap i need a unique value.
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Where is this information held and where do you want the results displayed and or stored?
 
Upvote 0
Where is this information held and where do you want the results displayed and or stored?
All in excel,
A column contains names
B column contains time information
Need(result) unique names in C column.
If still didn't got it , let me know i will try to upload an excel sheet ... currently i can't upload apologies for that
 
Upvote 0
Put this formula in column C.

=IF(ROW()=2,$A2,IF($A2<>$A1,$A2,IF(MINUTE($B2-$B1)>=10,$A2,"")))

Let me know if I have not got your requirements correct.
 
Upvote 0
Put this formula in column C.

=IF(ROW()=2,$A2,IF($A2<>$A1,$A2,IF(MINUTE($B2-$B1)>=10,$A2,"")))

Let me know if I have not got your requirements correct.
Thanks for the quick revert!!
Formula worked like gem!!
I will provide you more insight into my requirement because a name is appearing twice in result eventhough the time gap is below 10 min..
I hope the attached pic gives you more info i.e. John and David kn 6th and 7th row shouldn't be in the results as the time gap is below 10 min..
 

Attachments

  • IMG_20220716_231240.jpg
    IMG_20220716_231240.jpg
    88.6 KB · Views: 14
Upvote 0
Thanks for the quick revert!!
Formula worked like gem!!
I will provide you more insight into my requirement because a name is appearing twice in result eventhough the time gap is below 10 min..
I hope the attached pic gives you more info i.e. John and David kn 6th and 7th row shouldn't be in the results as the time gap is below 10 min..
Can I have the formulae corrected to match my requirement please..
 
Upvote 0
Does this do what you want (MS 365)

22 07 20.xlsm
ABC
1NamesTimeResult
2John10:00John
3Peter10:00Peter
4David10:05David
5Sam10:05Sam
6John10:05 
7David10:09 
8Jerry10:15Jerry
9Mike10:20Mike
10Roy10:20Roy
11John10:30John
Check Time
Cell Formulas
RangeFormula
C2:C11C2=IFNA(IF(B2-MAX(FILTER(B$1:B1,A$1:A1=A2,NA()))<TIME(0,10,0),"",A2),A2)
 
Upvote 0
.. or for more versions (assuming the above results are what you want) try

22 07 20.xlsm
ABC
1NamesTimeResult
2John10:00John
3Peter10:00Peter
4David10:05David
5Sam10:05Sam
6John10:05 
7David10:09 
8Jerry10:15Jerry
9Mike10:20Mike
10Roy10:20Roy
11John10:30John
Check Time
Cell Formulas
RangeFormula
C2:C11C2=IF(B2-IFERROR(AGGREGATE(14,6,B$1:B1/(A$1:A1=A2),1),0)<TIME(0,10,0),"",A2)
 
Upvote 0
Thanks for the help Peter, its working
.. or for more versions (assuming the above results are what you want) try

22 07 20.xlsm
ABC
1NamesTimeResult
2John10:00John
3Peter10:00Peter
4David10:05David
5Sam10:05Sam
6John10:05 
7David10:09 
8Jerry10:15Jerry
9Mike10:20Mike
10Roy10:20Roy
11John10:30John
Check Time
Cell Formulas
RangeFormula
C2:C11C2=IF(B2-IFERROR(AGGREGATE(14,6,B$1:B1/(A$1:A1=A2),1),0)<TIME(0,10,0),"",A2)
 
Upvote 0

Forum statistics

Threads
1,215,153
Messages
6,123,325
Members
449,097
Latest member
gameover8

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