[Solved] Time sheet formula

Discuss the spreadsheet application
Post Reply
Daddymae
Posts: 10
Joined: Wed Apr 06, 2016 2:52 pm

[Solved] Time sheet formula

Post by Daddymae »

=IF(S8>0;T8-S8)
I'm using this formula in a time sheet and it gives me total hours worked per day however, I then need it to deduct 1 hour but only if the total hours worked are more than 6.

Can anyone furnish me with a solution please as I've spent many days trying to solve it. It seems to be a simple equation but I'm a new user and I just can't get it?
Any help would be greatly appreciated.

Thank you!
Last edited by Daddymae on Thu Apr 21, 2016 12:16 am, edited 1 time in total.
Apache OpenOffice 4.1.1
Windows 10
User avatar
Villeroy
Volunteer
Posts: 31365
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Time sheet formula

Post by Villeroy »

T8-S8 returns the difference.
=MIN(T8-S8 ; 1/24) returns either the difference or 1 hour depending on which one is smaller.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
Daddymae
Posts: 10
Joined: Wed Apr 06, 2016 2:52 pm

Re: Time sheet formula

Post by Daddymae »

Thank you for your quick reply Villeroy

Although it doesn't solve my problem. If an employee works for 5 hours that's what he is paid. If he works for 8 hours, 1 hour is deducted for lunch break and he is paid for 7 hours. What I need the formula to do is if total hours worked exceed 6 hours then 1 hour needs to be deducted. Example: if 4 hours worked then 4 hours paid but if 7 hours worked = 6 hours paid, if 8 hours worked = 7 hours paid and so on.

Your formula works but it doesn't go past the parameters that are set within it, I need it to deduct 1 hour from the total hours worked over 6 hours if that makes sense?
Apache OpenOffice 4.1.1
Windows 10
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Time sheet formula

Post by RusselB »

If your times are true times, which for Calc means portions of a day, then I think you'd want

Code: Select all

=T8-S8-if(T8-S8>1/4;1/24;0)
On the other hand, if your times are not being entered as portions of a day, then you probably want

Code: Select all

=T8-S8-if(T8-S8>6;1;0)
Try both codes to see which one works for you. If, by some chance, neither one works, then please attach an example of your spreadsheet so that we can see just how your numbers are being handled.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
Daddymae
Posts: 10
Joined: Wed Apr 06, 2016 2:52 pm

Re: Time sheet formula

Post by Daddymae »

Cracked it RussellB, thank you!

It was your true times formula that worked :bravo: .

You have my most sincere gratitude!
Kindest regards
Apache OpenOffice 4.1.1
Windows 10
Post Reply