|You don't need VBA just to determine the Clerk with the longest Idle Time.|
This table shows that Steve has been idle the longest:
A B C D E
1 Name Time Done Time Now Idle Longest Idle
2 Bob 3:45 AM 7:46 PM 16:01:06 Steve
3 Sue 3:44 AM 7:46 PM 16:02:06
4 Steve 3:42 AM 7:46 PM 16:04:06
5 Mary 3:47 AM 7:46 PM 15:59:06
Column A is manual entries of Names.
Column B is manual entries of Completed Task Times (shortened to Time Done for this post) and is formatted as Time...1:30 PM.
Column C contains =NOW() and is formatted as Time...1:30 PM.
Column D contains =C2-B2 (drag down) formatted as Custom...h:mm:ss.
LARGE(D2:D5,1) will evaluate to 16:04:06 (in this example)
MATCH(LARGE(D2:D5,1),D2:D5,0) will evaluate to 3 which will be used as the row_num for the INDEX function.
=INDEX(A2:A5,MATCH(LARGE(D2:D5,1),D2:D5,0),1) will be equivalent to
=INDEX(A2:A5,3,1) which will return Steve.
Each time you enter a time in Column B, the values will update and the name with the longest Idle Time will appear in E2.
If you want a list of Clerks "automatically" ranked by Idle Time, Longest to Shortest, for the table above, put this in E2 and drag it down:
The ROW()-1 function will evaluate to 1 then 2 then 3 etc. and be used as the k argument for the LARGE function.
BTW...All of the Idle Times will update whenever the sheet calculates, but the name won't change because everyone's Idle Time will update by the same amount.