#1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
CCS CCS is offline
external usenet poster
 
Posts: 1
Default Tracking Time


This formula is to track the breaks/lunch (time) taken by an employee.
They are entitled to 1hour 30mins total. If they do not take the full
time then the company gains those minutes.
The following formula is being used:
=IF(C16=0,0,IF(LEN(C16)<4,-$P$6,((HOUR(C16)*3600+MINUTE
(C16)*60+SECOND(C16))-$P$6)/60))

Note: (p6) = 1800 and data is entered as hh:mm:ss
The problem is when a zero value is entered (i.e. the employee does not
take his/her break/lunch) it does not give the gained minutes but leaves
it as 0.

Please assist


--
CCS
------------------------------------------------------------------------
CCS's Profile: http://www.excelforum.com/member.php...o&userid=36236
View this thread: http://www.excelforum.com/showthread...hreadid=560180

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 623
Default Tracking Time

When you tell Excel if C16 is 0, I want a 0 result, amazingly enough, that's
what you get.

So if C16 is 0, what result do you want? Put that as the second parameter in
your If statement (replacing the 0).

Also, "((HOUR(C16)*3600+MINUTE(C16)*60+SECOND(C16))" can be simplified to
c16*86400.

Also, if employees are entitled to a 90 minute break, why is P6 = 1800
(seconds), or 30 minutes. Why wouldn't it be 90 minutes?

--
Regards,
Fred


"CCS" wrote in message
...

This formula is to track the breaks/lunch (time) taken by an employee.
They are entitled to 1hour 30mins total. If they do not take the full
time then the company gains those minutes.
The following formula is being used:
=IF(C16=0,0,IF(LEN(C16)<4,-$P$6,((HOUR(C16)*3600+MINUTE
(C16)*60+SECOND(C16))-$P$6)/60))

Note: (p6) = 1800 and data is entered as hh:mm:ss
The problem is when a zero value is entered (i.e. the employee does not
take his/her break/lunch) it does not give the gained minutes but leaves
it as 0.

Please assist


--
CCS
------------------------------------------------------------------------
CCS's Profile:
http://www.excelforum.com/member.php...o&userid=36236
View this thread: http://www.excelforum.com/showthread...hreadid=560180



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hot key for time? Dave in Des Moines Excel Discussion (Misc queries) 1 March 24th 06 03:46 PM
Tracking Time brucek Excel Discussion (Misc queries) 1 March 22nd 06 09:16 PM
Excel form for tracking task time JackD Excel Discussion (Misc queries) 0 February 22nd 06 11:01 PM
time sheet to calculate 2 different columns John Sullivan Excel Worksheet Functions 1 October 21st 05 06:48 AM
Tracking Time (Hours/Mins) sdmccabe Excel Discussion (Misc queries) 1 February 1st 05 04:39 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"