+ Reply to Thread
Results 1 to 10 of 10

Formulas to autosum shift hours

  1. #1
    Registered User
    Join Date
    05-18-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    14

    Question Formulas to autosum shift hours

    I use a spreadsheet to calculate work hours monthly
    I created a Vlookup table so A shift =4hrs B shift=6 hrs C=8hr etc
    On the spreadsheet if A1 is John and B1-W1 are the various shifts he worked within this period. Can I have a formulas to sum up the total hours automatically. TIA

  2. #2
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Formulas to autosum shift hours

    I'm guessing a bit here since you didn't attach a workbook with your layout , but you can sum hours represented by A, B and C in B1:W1 this way:
    =COUNTIF(B1:W1,"A")*4+COUNTIF(B1:W1,"B")*6+COUNTIF(B1:W1,"C")*8

  3. #3
    Registered User
    Join Date
    05-18-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formulas to autosum shift hours

    Thanks for your prompt reply. I wonder how many " countif " allowed.

  4. #4
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Formulas to autosum shift hours

    Not sure, but there can't be that many types of shifts?
    If this is a problem, you could always make a summary table to sum hours for each type of shift first.

  5. #5
    Registered User
    Join Date
    05-18-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formulas to autosum shift hours

    I have tried it and I can put in 10+ "countif" but the formulas is very long.
    I just setup a Vlookup table to define A=4, B=6 etc and wonder if I can sum the hours using the table to make the formulas shorter.

  6. #6
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326

    Re: Formulas to autosum shift hours

    Hi
    better to attach a small sample of your data with what you have and what you need - Much easier than guesswork

  7. #7
    Valued Forum Contributor
    Join Date
    10-06-2008
    Location
    Norway
    MS-Off Ver
    2010
    Posts
    365

    Re: Formulas to autosum shift hours

    I don't really understand what you mean by using vlookup to define A, B and C. Apart from that It is entirely possible that you can construct a formula to make the calculation in one cell for each person. To me, it however seems much easier to use a table with names as row,the different shifttypes as columns, and the values being count of the shifttype multiplied by hours for that particular shift.

  8. #8
    Registered User
    Join Date
    05-18-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formulas to autosum shift hours

    Thanks Estige, this is exactly what I need. Sorry to ask stupid question but I am not too familiar with Excel.
    What kind of table I need ?

  9. #9
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formulas to autosum shift hours

    Quote Originally Posted by AndyL3 View Post
    I have tried it and I can put in 10+ "countif" but the formulas is very long.
    Using the earlier example of:

    Please Login or Register  to view this content.
    You can re-write as:

    Please Login or Register  to view this content.
    add the additional items as necessary.

  10. #10
    Registered User
    Join Date
    05-18-2011
    Location
    Vancouver, Canada
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Formulas to autosum shift hours

    Thanks DonkeyOte, it works like a charm. Now I can put my calculator away
    Thanks again

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1