+ Reply to Thread
Results 1 to 14 of 14

Need to calculate a total from a range of cells on different sheets

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Need to calculate a total from a range of cells on different sheets

    Hello,
    I am new to this, so i appreciate your patience and help in advance! I have a file that I need to have PTO hours calculated. I have attached the file.
    Basically, people (joe, susy, griffin, tom, etc) will enter their PTO hours in the month and day that they will be taking it. There will be seperate sheets for each month of the year (my file currently only has July and August). I want the total PTO hours per person added together and seen on a seperate sheet within the workbook (PTO_Totals).
    I have tried several nested IF formulas that ended up being too cumbersome, and I don't know enough about VBE to create a macro.
    Please help. Thank you!

    Sample.xlsx
    Last edited by jrosko1; 06-21-2012 at 07:02 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1 ,

    Welcome to the Forum!

    It looks like columns "L:W" are not being used. I say that because the formula in column "K" will display FULL if columns "E:J" of the same row contain entries. Do plan on using these columns (L:W) later on?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    Hi, yes, I forgot to mention that, thanks! k:w will possibly be used (they will act as "overflow"), so I would need to incorporate those columns into the formula or macro

  4. #4
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    Correction: L:W, K will not be involved

  5. #5
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1,

    Thanks, that won't be a problem.

  6. #6
    Valued Forum Contributor StevenM's Avatar
    Join Date
    03-23-2008
    Location
    New Lenox, IL USA
    MS-Off Ver
    2007
    Posts
    910

    Re: Need to calculate a total from a range of cells on different sheets

    Maybe I misunderstood what you needed.

    But see: jrosko1_Sample.xlsm

    Go to: PTO_Totals

    Run the macro: Run_UpDateMonth

  7. #7
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1,

    I always seem to get phone calls when I am writing code. I moved the named range "NAME" from the "Dropdowns" sheet to the "PTO_Totals" sheet and made it dynamic. Now if you add or delete names the range adjusts automatically. A button was added to the "PTO_Totals" sheet to run the macro below.
    Please Login or Register  to view this content.
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    That is awesome, thanks Leith Ross! I love the button, great stuff. And it functions perfectly like it's supposed to.... I have just one request. The dropdowns for columns E, G, I, L, N, P, R, T, V are not populating any names at this point? Is it possible to update to have the names show up, even if the list gets modified. I tried messing around with it, but am only receiving errors
    Last edited by jrosko1; 06-21-2012 at 09:46 PM.

  9. #9
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1,

    You can select all the cells with drop downs on the sheet and reset the Validation List to point to "NAME" by typing in "=NAME" at the bottom of the validation dialog.

  10. #10
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    Hmmmm, ok, tried that already, but will try again! I probably mis-keyed something! Thanks again!

  11. #11
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    Hello Mr. Ross,
    I can't figure it out, so I need your help once more. I have attached the file, just in case something happened in transition. But I went in and reset the validation and still am getting the dropdown with a blank, not the appropriate list of names. Can you take a look? Thanks!!PTOv2.xls

  12. #12
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1,

    The problem was the with the formula for the "NAME". That was my fault. It was using relative addressing instead of absolute. Here is how it should appear...
    =OFFSET(PTO_Totals!$A$1,1,0,COUNTA(PTO_Totals!$A:$A)-1, 1)
    The attached workbook has the change made to it.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    06-21-2012
    Location
    GB, WI
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Need to calculate a total from a range of cells on different sheets

    AWESOME! I have learned a lot and you have been a great help! THANK YOU!

  14. #14
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Need to calculate a total from a range of cells on different sheets

    Hello jrosko1,

    You're welcome. Glad I could help.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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