» Finding the maximum value of all those meeting a certain criteria.
CATEGORY - Excel Date & Time Formulas
VERSION - All Microsoft Excel Versions
Range A2:C10 contains the login and logout times of various ID's.
Each ID could log in and out a number of times a day.
How could we find the first time a specific ID logged in and the last time that same ID logged out?
Solution:
For each of the ID's in range A2:A10, enter two Array Formulas.
To find the first login time (Column B) enter the following formula:
{=1/MAX((A14=$A$2:$A$10)*($B$2:$B$10<>0)*(1/$B$2:$B$10))}
To find the last logout time (Column C) enter the following formula:
{=MAX(($A$2:$A$10=A14)*($C$2:$C$10))}
ID______Login Time______Logout Time
1 ______02:40___________03:10
2 ______00:15___________03:20
1 ______06:20___________09:30
3 ______09:14___________11:05
4 ______11:00___________19:30
2 ______04:05___________06:55
3 ______12:08___________17:17
1 ______10:00___________16:20
2 ______08:12___________12:33
ID______First Login Time______Last Logout Time
1 ______2:40__________________16:20
2 ______0:15__________________12:33
3 ______9:14__________________17:17
4 ______11:00_________________19:30

Book Store:
Recommended Books:
Returns #value!
samad
This formula shows results #value! when I same copied to excel sheet. I checked format of login time & logout time but it could not solve the problem Please guide me .
Thanks
[email]xxsamad.gadit@gmail.com[/email]
(remove xx)
Reply: samad
Alan
Hi samad,
[QUOTE=samad]This formula shows results #value! when I same copied to excel sheet. I checked format of login time & logout time but it could not solve the problem Please guide me .
Thanks
[email]xxsamad.gadit@gmail.com[/email]
(remove xx)[/QUOTE]Which formula? Also, what are the values in the source data cells?
Thanks,
Alan.
samad
Hi Alan
[=1/MAX((A14=$A$2:$A$10)*($B$2:$B$10<>0)*(1/$B$2:$B$10))]
The formula describe in this tip. I hope now it clerify.
Thanks for taking interest & hope you'll reply soon.
Problem:
Range A2:C10 contains the login and logout times of various ID's.
Each ID could log in and out a number of times a day.
How could we find the first time a specific ID logged in and the last time that same ID logged out?
Solution:
For each of the ID's in range A2:A10, enter two Array Formulas.
To find the first login time (Column B) enter the following formula:
=1/MAX((A14=$A$2:$A$10)*($B$2:$B$10<>0)*(1/$B$2:$B$10))
To find the last logout time (Column C) enter the following formula:
{=MAX(($A$2:$A$10=A14)*($C$2:$C$10))}
ID______Login Time______Logout Time
1 ______02:40___________03:10
2 ______00:15___________03:20
1 ______06:20___________09:30
3 ______09:14___________11:05
4 ______11:00___________19:30
2 ______04:05___________06:55
3 ______12:08___________17:17
1 ______10:00___________16:20
2 ______08:12___________12:33
ID______First Login Time______Last Logout Time
1 ______2:40__________________16:20
2 ______0:15__________________12:33
3 ______9:14__________________17:17
4 ______11:00_________________19:30
mangesh_yadav
Hi Samad,
The formula works perfectly fine. But you are not using it as an array formula. After entering the formula, you need to press control - shift - enter.
Mangesh
samad
Thank you Mangesh this is new thing to learn for me
[email]xxsamad.gadit@gmail.com[/email]
(remove xx)
mangesh_yadav
Thanks for the feedback.
Mangesh
Subtotals
Anis Shekha
Can any one please help me find the tip "Deleting the Word "Total" from the subtotal List"
Reply: Anis Shekha
Alan
Hi Anis,
[QUOTE=Anis Shekha]Can any one please help me find the tip "Deleting the Word "Total" from the subtotal List"[/QUOTE]Just google it:
[url]http://www.google.co.nz/search?hl=en&q=%22Deleting+the+Word+%22%22Total%22%22+from+the+subtotal+List%22&meta=[/url]
OR
[url]http://tinyurl.com/bq4wr[/url]
Alan.


The suggested formula:
=1/MAX((A14=$A$2:$A$10)*($B$2:$B$10<>0)*(1/$B$2:$B$10))
will always lead to a divide-by-zero error if the time 00:00 is in the table. This in turn causes the MAX() function to produce a divide-by-zero error.
The formula below solves that problem by including a very large value for the MAX() function to choose in case a 00:00 time is in the table. The reciprocal will then be small enough for the formula to return 0:00, as expected.
=1/MAX((A14=$A$2:$A$10)*IF(ISERROR(1/$B$2:$B$10),10^6,1/$B$2:$B$10))