Reply to topic  [ 4 posts ] 
Excel/Spreadsheet calculating hours 
Author Message
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
Hi all,

I'm creating a spreadsheet to work out what hours I've worked and how much I'm earning. At work if I work within 7:30am - 17:30pm I get paid at one rate, and all other times (including all Saturday and Sunday) I get paid a different rate. Also, 30 minutes lunch is taken from whichever period of work is largest (e.g. if I work 9:00 - 18:00 then I'd get 30 minutes taken out of the 7:30-17:30 period).

I'm having problems calculating this without manually separating the hours out and I can't think how it could be done through a formulae, can anyone help?

Many thanks,
Ben


Fri Dec 03, 2010 4:54 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 7:35 pm
Posts: 6580
Location: Getting there
Reply with quote
I'm not at my computer now but I would suggest converting the hours into decimals i.e. 17:30 = 17.5

That way you can easily take out the minutes before and after the specified times

_________________
Oliver Foggin - iPhone Dev

JJW009 wrote:
The count will go up until they stop counting. That's the way counting works.


Doodle Sub!
Game Of Life

Image Image


Fri Dec 03, 2010 6:41 pm
Profile WWW
Site Admin
User avatar

Joined: Fri Apr 24, 2009 6:12 am
Posts: 7011
Location: Wiltshire
Reply with quote
Ben

This isn't complete but most of the way there.

Column A is date of start of work
Column B is time of start of work ( 24 hour clock )
Column C is time of end of work ( 24 hour clock )
day_end is the 17:30 time you stated.
day_start is the 07:30 you stated.
rate1 is basic hourly rate cell.
rate2 is out of hours rate cell.

it copes with day of week and going over the normal hours end time along with starting before normal hours

Code:
=IF(WEEKDAY(A15)=1,rate2*HOUR(C15-B15),IF(WEEKDAY(A15)=7,rate2*HOUR(C15-B15),IF(C15>day_end,SUM((HOUR(day_end-B15)*rate1)+(HOUR(C15-day_end)*rate2)),IF(B15>day_end,HOUR(C15-B15)*rate2,IF(B15<day_start,SUM((HOUR(day_start-B15)*rate2)+(HOUR(C15-day_start)*rate1)),HOUR(C15-B15)*rate1)))))


I haven't done the 30 minute deduction . I'm also struggling with anything that isn't a whole hour. :roll: So you may need to use numbers as opposed to time.

Hope that helps I'll send you the spread sheet if you like

_________________
<input type="pickmeup" name="coffee" value="espresso" />


Sat Dec 04, 2010 4:25 pm
Profile WWW
I haven't seen my friends in so long
User avatar

Joined: Thu Apr 23, 2009 6:36 pm
Posts: 5150
Location: /dev/tty0
Reply with quote
Thanks Alun,

I'll take a better look at it tomorrow/Monday (my head isn't up to it atm), but it looks good :)


Sat Dec 04, 2010 6:05 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.