+ Reply to Thread
Results 1 to 3 of 3

Need help with formula to sum certain cells in multiple worksheets depending on a variable

  1. #1
    Registered User
    Join Date
    04-05-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    15

    Need help with formula to sum certain cells in multiple worksheets depending on a variable

    I thought I had this formula right and it seemed to be working fine, but I've hit a snag and can't figure out why it's doing this. Here's the crazy formula I'm working with, I added color coding to try making it a little less confusing:

    Please Login or Register  to view this content.
    Here's what I'm trying to do in layman's terms: I have sheets labeled "Daily_Worksheet" with a number, like Daily_Worksheet0, Daily_Worksheet1, Daily_Worksheet2, etc. and the user can keep adding more sheets. I added the INDIRECT function as a way to get this formula to automatically add the data from each worksheet no matter how many there are. The INDIRECT function is ultimately supposed to end up with the expression "Daily_Worksheet0:Daily_Worksheet#!$A12:$B22" (with "#" being the number of the last sheet). The the SUMIF function is supposed to use that expression to look in all of the "Daily_Worksheet" sheets in cells A12:B22 for the value in cell A4 of the SUMMARY sheet (in this case labor categories like "Chemist"), and if it finds that value it should return the value in the same row from column I.

    I'm sure that's all as clear as a bowl of pudding.... If you're with me so far, the problem I'm having is with the part of the formula in italics. The INDIRECT function seems to be set up correctly but the SUMMARY sheet is only adding together the values from sheets Daily_Worksheet0 and Daily_Worksheet4, not Daily_Worksheet0 through Daily_Worksheet4. I can't figure out why though, when I try testing out individual parts of the above formula they work correctly but when I stick them all together they don't. Anyone have any suggestions???

    Thanks!!

  2. #2
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Need help with formula to sum certain cells in multiple worksheets depending on a vari

    If all the sheets are the same format, why not make an summary sheet of all worksheets.

    After that you can use easily all other formula's to get the desired result.
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  3. #3
    Registered User
    Join Date
    04-05-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Need help with formula to sum certain cells in multiple worksheets depending on a vari

    Well I ended up giving up on that formula above and did what you suggested and I think it'll have to do. Thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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