#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Timesheet - Formula

Goal: I want to subtract lunch time if I work over 5 hours, otherwise I
want
to know the hours worked if under 5 hours)


Details:

Cell A10 - lunch time, cell is number format, time
Cell E10 - time I arrived at work, custom cell format h:mm AM/PM
Cell F10 - time I leave work, custom cell format h:mm AM/PM
Cell B10 - is cell to enter the formula and then convert it to decimal

=If(F10-E10 is greater than 5 hours, then F1-E10-A10, else, F10-E10)*24
(it is mandatory to take lunch if you work 5 hours or more)

Can anyone provide the correct formula and/or cell formats?

My problem is that I don't know how to recognize the 5 hours in the formula.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 8,651
Default Timesheet - Formula

5 hours is 5/24, or TIME(5,,)
--
David Biddulph

--Viewpoint wrote:
Goal: I want to subtract lunch time if I work over 5 hours,
otherwise I want to know the hours worked if under 5 hours)


Details:

Cell A10 - lunch time, cell is number format, time
Cell E10 - time I arrived at work, custom cell format h:mm AM/PM
Cell F10 - time I leave work, custom cell format h:mm AM/PM
Cell B10 - is cell to enter the formula and then convert it to decimal

=If(F10-E10 is greater than 5 hours, then F1-E10-A10, else,
F10-E10)*24 (it is mandatory to take lunch if you work 5 hours or
more)

Can anyone provide the correct formula and/or cell formats?

My problem is that I don't know how to recognize the 5 hours in the
formula.




  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,203
Default Timesheet - Formula

"my problem is that I don't know how to recognize the 5 hours in the formula."

I'll give you that answer and I'll bet you can figure the rest out on your
own. 5 hours in 'Excel time' is .208333 (5 / 24). Excel tracks time in
terms of days and fractions of days. If you look at a date in General or
Number format, you'll find it's a large number: Feb 2, 2010 is actually
stored as 40211.0 in Excel (40,211 days after Jan 1, 1900). Hours, minutes
and seconds are stored as the decimal value to the right of the decimal
point, with .00 being Midnight at the start of the day.

So 5 hours = 5/24 of one day = 0.208333

Your formula could start off as something like:
=IF(F10-E10.208333," greater than 5 hrs","less than or equal to 5 hrs")
or even
=IF(F10-E10(5/24),"gt 5","not gt 5")


"--Viewpoint" wrote:

Goal: I want to subtract lunch time if I work over 5 hours, otherwise I

want
to know the hours worked if under 5 hours)


Details:

Cell A10 - lunch time, cell is number format, time
Cell E10 - time I arrived at work, custom cell format h:mm AM/PM
Cell F10 - time I leave work, custom cell format h:mm AM/PM
Cell B10 - is cell to enter the formula and then convert it to decimal

=If(F10-E10 is greater than 5 hours, then F1-E10-A10, else, F10-E10)*24
(it is mandatory to take lunch if you work 5 hours or more)

Can anyone provide the correct formula and/or cell formats?

My problem is that I don't know how to recognize the 5 hours in the formula.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Timesheet - Formula

Thank you so much. It was so simple and I wished I had remembered this
concept as I was aware of it. I just don't have much experience with Excel
so I always need to reach out for help. Thanks, again.

"JLatham" wrote:

"my problem is that I don't know how to recognize the 5 hours in the formula."

I'll give you that answer and I'll bet you can figure the rest out on your
own. 5 hours in 'Excel time' is .208333 (5 / 24). Excel tracks time in
terms of days and fractions of days. If you look at a date in General or
Number format, you'll find it's a large number: Feb 2, 2010 is actually
stored as 40211.0 in Excel (40,211 days after Jan 1, 1900). Hours, minutes
and seconds are stored as the decimal value to the right of the decimal
point, with .00 being Midnight at the start of the day.

So 5 hours = 5/24 of one day = 0.208333

Your formula could start off as something like:
=IF(F10-E10.208333," greater than 5 hrs","less than or equal to 5 hrs")
or even
=IF(F10-E10(5/24),"gt 5","not gt 5")


"--Viewpoint" wrote:

Goal: I want to subtract lunch time if I work over 5 hours, otherwise I

want
to know the hours worked if under 5 hours)


Details:

Cell A10 - lunch time, cell is number format, time
Cell E10 - time I arrived at work, custom cell format h:mm AM/PM
Cell F10 - time I leave work, custom cell format h:mm AM/PM
Cell B10 - is cell to enter the formula and then convert it to decimal

=If(F10-E10 is greater than 5 hours, then F1-E10-A10, else, F10-E10)*24
(it is mandatory to take lunch if you work 5 hours or more)

Can anyone provide the correct formula and/or cell formats?

My problem is that I don't know how to recognize the 5 hours in the formula.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 21
Default Timesheet - Formula

Great - thanks for your help.

"David Biddulph" wrote:

5 hours is 5/24, or TIME(5,,)
--
David Biddulph

--Viewpoint wrote:
Goal: I want to subtract lunch time if I work over 5 hours,
otherwise I want to know the hours worked if under 5 hours)


Details:

Cell A10 - lunch time, cell is number format, time
Cell E10 - time I arrived at work, custom cell format h:mm AM/PM
Cell F10 - time I leave work, custom cell format h:mm AM/PM
Cell B10 - is cell to enter the formula and then convert it to decimal

=If(F10-E10 is greater than 5 hours, then F1-E10-A10, else,
F10-E10)*24 (it is mandatory to take lunch if you work 5 hours or
more)

Can anyone provide the correct formula and/or cell formats?

My problem is that I don't know how to recognize the 5 hours in the
formula.




.

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
Timesheet formula problem Leo Excel Worksheet Functions 3 January 7th 10 09:51 AM
timesheet and overtime formula/s Andy Bolger Excel Discussion (Misc queries) 3 July 22nd 09 04:45 PM
Need help with a timesheet formula TSuraco Excel Discussion (Misc queries) 1 June 6th 08 01:28 AM
Timesheet Formula Help Please! HRLegal Excel Worksheet Functions 3 March 17th 08 04:28 PM
TIMESHEET FORMULA JANET Excel Worksheet Functions 1 November 22nd 04 11:39 PM


All times are GMT +1. The time now is 10:21 PM.

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"