473,419 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,419 software developers and data experts.

MS Excel ...total hrs worked formula

22
Not that of a guru with excel but tryin to write a formula that will calculate total hrs worked for normal mon-fri 9a-5p week schedule. I have figured out how to calculate daily totals but for week total I would assume I need an "if" statement. I am not sure how to write this but would greatly appreciate some help.
thank you


Expand|Select|Wrap|Line Numbers
  1. Day    Time In    Time Out    Time In    Time Out    Total Hrs
  2. mon    9:00    13:00    14:00    17:00    8:00
  3. tue    9:00    13:00    14:00    17:00    8:00
  4. wed    9:00    13:00    14:00    17:00    8:00
  5. thu    9:00    13:00    14:00    17:00    8:00
  6. fri    9:00    13:00    14:00    17:00    8:00
  7.             Week Total              [need formula or code]
Feb 13 '07 #1
11 19151
ronverdonk
4,258 Expert 4TB
Why don't you use the standard Excel SUM() function, whereby you sum the previous 5 cells?

Ronald
Feb 13 '07 #2
Ganon11
3,652 Expert 2GB
Not that of a guru with excel but tryin to write a formula that will calculate total hrs worked for normal mon-fri 9a-5p week schedule. I have figured out how to calculate daily totals but for week total I would assume I need an "if" statement. I am not sure how to write this but would greatly appreciate some help.
thank you
I don't think you'll need any sort of if statement. Looking at your data,


Expand|Select|Wrap|Line Numbers
  1. Day    Time In     Time Out   Time In    Time Out    Total Hrs
  2. mon    9:00     13:00       14:00        17:00        8:00
  3. tue    9:00     13:00       14:00        17:00        8:00
  4. wed    9:00     13:00       14:00    17:00        8:00
  5. thu    9:00     13:00       14:00    17:00        8:00
  6. fri    9:00     13:00       14:00        17:00        8:00
  7.             Week Total              
I assume the Total Hrs cells are formulas totaling the hours for that day. Then your Week Total cell can have a formula adding up the Total Hrs values as you did with the daily totals.
Feb 13 '07 #3
bartonc
6,596 Expert 4TB
Not that of a guru with excel but tryin to write a formula that will calculate total hrs worked for normal mon-fri 9a-5p week schedule. I have figured out how to calculate daily totals but for week total I would assume I need an "if" statement. I am not sure how to write this but would greatly appreciate some help.
thank you


Expand|Select|Wrap|Line Numbers
  1. Day    Time In    Time Out    Time In    Time Out    Total Hrs
  2. mon    9:00    13:00    14:00    17:00    8:00
  3. tue    9:00    13:00    14:00    17:00    8:00
  4. wed    9:00    13:00    14:00    17:00    8:00
  5. thu    9:00    13:00    14:00    17:00    8:00
  6. fri    9:00    13:00    14:00    17:00    8:00
  7.             Week Total              [need formula or code]
In my timesheet, column a is an actual date. This forumul allows for more that one project to be worked on for a certain date.
Expand|Select|Wrap|Line Numbers
  1. =IF(A13=A14;"";G13)
  2. =IF(H13="";"";(H13*17)+K13)
My columns look something like this
Expand|Select|Wrap|Line Numbers
  1. Day    Time In    Time Out    Break    Project    Total Hrs
  2. 1/1/07    9:00    11:30            2.5
  3. 1/1/07    11:30    17:00    1        4.5
  4. 1/2/07    9:00    17:00    1        7
  5.  
  6.             Week Total              [need formula or code]
  7. =SUM(I13:I158)+E7
  8.  
I guess no one noticed that 9 to 5 minus one doesn't equal 8 hours.
Feb 13 '07 #4
bartonc
6,596 Expert 4TB
Sorry, time (5 min.) to edit ran out.
Expand|Select|Wrap|Line Numbers
  1. =IF(NOT(E13="");((E13-D13)*24)-F13;"")
  2. =IF(A13=A14;"";G13)
  3. =IF(H13="";"";(H13*17)+K13)
My columns look something like this
Expand|Select|Wrap|Line Numbers
  1. Day    Project    Time In    Time Out    Break    Hours    Day hours    Total $
  2. 1/1/07        9:00    11:30        2.5
  3. 1/1/07        11:30    17:00    1    4.5    7
  4. 1/2/07        9:00    17:00    1    7    7
  5.  
  6.             Week Total              [need formula or code]
  7. =SUM(I13:I158)+E7
  8.  
I guess no one noticed that 9 to 5 minus one doesn't equal 8 hours.
Feb 13 '07 #5
Lloydm
22
Why don't you use the standard Excel SUM() function, whereby you sum the previous 5 cells?

Ronald
I tried doing it but no luck. Seems as if whenever the total hrs = 24:00 it resets to 0:00 resulting in 16:00 total work week hrs [ my formula -> =SUM(F4:F8) ]

Total Hrs
8:00
8:00
8:00
8:00
8:00
----------
16:00
Feb 13 '07 #6
Lloydm
22
Sorry, time (5 min.) to edit ran out.
Expand|Select|Wrap|Line Numbers
  1. =IF(NOT(E13="");((E13-D13)*24)-F13;"")
  2. =IF(A13=A14;"";G13)
  3. =IF(H13="";"";(H13*17)+K13)
My columns look something like this
Expand|Select|Wrap|Line Numbers
  1. Day    Project    Time In    Time Out    Break    Hours    Day hours    Total $
  2. 1/1/07        9:00    11:30        2.5
  3. 1/1/07        11:30    17:00    1    4.5    7
  4. 1/2/07        9:00    17:00    1    7    7
  5.  
  6.             Week Total              [need formula or code]
  7. =SUM(I13:I158)+E7
  8.  
I guess no one noticed that 9 to 5 minus one doesn't equal 8 hours.
Thanks for your reply, I included no calculation -1 for lunch time I simply calculated total hrs for workday as end time - start time

Day---------Time In--------Time Out----Time In----Time Out------Total Hrs
mon--------- 9:00-----------13:00-----------14:00------17:00-----------8:00

seems as if when total work week hrs = 24:00 it resets itself to 0:00 resulting in 16:00 for work week
Feb 13 '07 #7
bartonc
6,596 Expert 4TB
Thanks for your reply, I included no calculation -1 for lunch time I simply calculated total hrs for workday as end time - start time

Day---------Time In--------Time Out----Time In----Time Out------Total Hrs
mon--------- 9:00-----------13:00-----------14:00------17:00-----------8:00

seems as if when total work week hrs = 24:00 it resets itself to 0:00 resulting in 16:00 for work week
You're welcome. I hope you can make use of those formulas. They solve this by converting to a decimal before the SUM() is used.
Feb 13 '07 #8
Lloydm
22
Here is what I've summarized.

1hr = 1/24 = 0.4166667 or rounded 0.417
1min = 1/24 x 60 = 0.000694
1sec = 1/24 x 60 x 60 = 0.00001157


Thus total hrs for any workday =8/24 as decimal = 0.333333333 rounded to 0.33

Total hrs for mon-fri would be 0.333333333 x 5 = 1.666666667
So we conclude total hrs (40) for mon-fri = 1.666666667 as serial or ie decimal
To convert a serial number to an hour I used the excel formula =hour(decimal value goes here) or ie hour(1.666666667)

My sheet is prefomatted with millitary time for allocated cells
The thing is, using =hour(decimal value) for each workday then =SUM(mon:fri) I have a valid answer of 40.
Using the formatted section will show as 0:00 when calculated, however when using sum funcition I arrive @ 960:00:00. I then divided 960:00:00/24hrs = 40:00:00

DAY-----Time-----Serial-------- =hour(serial)--------=hour(serial) with millitaryformat
mon-----8:00-----0.333333333--------8------------------------ 0:00
tue-------8:00-----0.333333333--------8------------------------ 0:00
wed------8:00-----0.333333333--------8------------------------ 0:00
thu-------8:00-----0.333333333--------8------------------------ 0:00
fri---------8:00-----0.333333333--------8------------------------ 0:00
TOTAL--16:00----1.666666667------40------------------ 960:00:00

TOTAL VALUE IN MILLITARY TIME 40:00:00 (960:00:00/24hrs)



I changed various day hrs and the formula seems to adjust to correct totalHrsWeek value when changed. It's always nice to find a resolution however If someone can also explain this more clearly to me I would appreciate
Feb 14 '07 #9
bartonc
6,596 Expert 4TB
What's wrong with
Expand|Select|Wrap|Line Numbers
  1. (E13-D13)*24
?
Feb 14 '07 #10
Lloydm
22
What's wrong with
Expand|Select|Wrap|Line Numbers
  1. (E13-D13)*24
?

I did but had no luck, I also found the following in excel help...

Formula Description (Result)
=SUM(A2:A5) Total hours worked when the total is less than a day (17:20)

=SUM(A2:A6)*24 Total hours worked when the total is greater than a day (25.33333).

I got my total hrs with equation.... =SUM(sun:mon)*24/24
thanks for your help. I DEEPLY & GREATLY APPRECIATE THIS
===============================================


Iv'e searched through the vb forum but had no luck finding a "print job" script. After saving file and before exit, I would like a script to prompt the user to send to printer
Feb 14 '07 #11
bartonc
6,596 Expert 4TB
I did but had no luck, I also found the following in excel help...

Formula Description (Result)
=SUM(A2:A5) Total hours worked when the total is less than a day (17:20)

=SUM(A2:A6)*24 Total hours worked when the total is greater than a day (25.33333).

I got my total hrs with equation.... =SUM(sun:mon)*24/24
thanks for your help. I DEEPLY & GREATLY APPRECIATE THIS
===============================================
You are welcome. I'm glad that you got it working.

Iv'e searched through the vb forum but had no luck finding a "print job" script. After saving file and before exit, I would like a script to prompt the user to send to printer
The VB forum is probably a good place to post this question.
Feb 14 '07 #12

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Srijith Augustine | last post by:
Hi, Record selection Formaula is not working while exporting the report to Excel There is absolutely no problem while using a crystal report viewer but if i export it to a excel the selection...
1
by: MAdcock | last post by:
I have been having major problems trying to write a piece of code to basically tally (add) values in a table (column B) that have the same product name (column A). The problem is that the table is...
3
by: Esmael | last post by:
Hi to all... Goodmorning am working on a Project on VB6. THis is an excel automation... the VB6 Program reads from the Excel File and transfer the search data if found to another excel file......
1
by: =?Utf-8?B?Q2hyaXMgd2FsbGVy?= | last post by:
I have a column of dates (A) on an Excel Spreadsheet. I would like a formula that gives me the Wednesday following. If the date is a Wednesday I would like it to show me the Wednesday of the...
1
by: barnzee | last post by:
Hi all, newbie here, but having a go I am trying to build a stock watchlist in excel 2007 with a dynamic link to a DDE server (paid for from a broker).There is no add-in or plug-in, I just CTL ALT...
3
by: muddasirmunir | last post by:
i am using vb6 and crystal report 10 with sqlserver 2000 i made a formulal field in crystal report 10 where i had a table name sales , it has two numeric fields credit and debit and give theme...
0
by: suresh_punniyakkodi | last post by:
Hellow Friends, I have one doubt, please help me... In Excel, i have lot of rows and coloumns, i need to read all cell values with in rows and coloumn limit... At the time...
11
by: bcr123 | last post by:
Hello all. If someone could please help me with the following formula. I'm using MS Excel, Office 2003. Formula is in Q23: If M22 is smaller than S22, than have value of D23, otherwise have...
1
by: premMS143 | last post by:
Hi everyone, I'm new to Excel VBA. One of our user given links to file in Excel using =HYPERLINK() formula to a lot of cells (approx. 5000 Cells). Now the thing is they dont want to display...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.