+ Reply to Thread
Results 1 to 11 of 11

conditional sum across worksheet pages

  1. #1
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    conditional sum across worksheet pages

    Hello,

    I'm new and greatly appreciate any help you can provide. I've scoured the internet for a solution to a problem I have (I most likely created the problem).

    I have been tasked with creating a workbook to budget the utility bills for each of our four districts. I have created running totals and rolling averages for each spreadsheet. The totals and averages are in the same cell on each of the sheets. The nature of the business we do, there can be a new account added at any time, so I created a macro to add a sheet preformatted with the proper table. If we weren't adding new sheets this would be a simpler process, and I have been trying my damnest to define a range of sheets (no cells) in order to allow me to create conditional totals on my front page.

    So, for the formula I need a total of the values in cells K13 if that page contains the word CPUH in cell h4. If the word "CPUH" is not written in cell H4 (either blank or a different phrase) I would like that page's value omitted from the total.

    Ive created two blank pages titled "Startsheet" and "Endsheet" that will bookend my range of worksheets. I thought I could just define a range, ala "define name, ='Startsheet:Endsheet'! " but the error "A formula in this worksheet contains one or more invalid references. Verify that your formulas contain a valid path, workbook, range name, and cell reference."

    I feel like this is possible. I'm just stuck. I need this workbook to be dummyproof so I can hand it off to someone else and they won't have to be able to troubleshoot, add formulas, etc. They just enter this months bill total, it automatically updates the front page with the up to date averages and totals.

    I've seen formulas that should work . . .

    =SUMPRODUCT(SUMIF(INDIRECT("`"&SheetList"`!H4"),"CPUH",INDIRECT("`"&SheetList"`!K13")))

    . . . where somehow sheetlist is magically defined without the terror (error) message above.

    Any help you can provide would be greatly appreciated.

    Best,

    Philip

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: conditional sum across worksheet pages

    I do like the idea of a terror message!!

    So, you were nearly there. The Named Range (SheetList) can be viewed by using CTRL F3. As for the rest, you used the wrong sort of tick (how naughty of you!! ). It needs to be ' and not `. Also there was the odd ampersand missing.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    Re: conditional sum across worksheet pages

    Thank you Glenn. Unfortunately I'm not sure the method for selecting a range will work for me. I need to find a way to create a defined range of sheets that can somehow include each new sheet my macro creates, so a dynamic range. I may just need to split my workbook into 4 separate workbooks based on the district, but ideally I could have this all in one sheet. So close!

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: conditional sum across worksheet pages

    I don't quite understand you... Once you crreate a new sheet, by whatever means, and enter anything, anywhere, the sheet list will update. It is a dynamic range... or am I missing the point, here???

  5. #5
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    Re: conditional sum across worksheet pages

    No sir, you have the point. I may be missing something and I will investigate further and report back. Many thanks for the assistance!

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: conditional sum across worksheet pages

    Did you enable macros when you opened the sheet??

  7. #7
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    Re: conditional sum across worksheet pages

    Glenn, I appreciate your patience with me. So what you're saying is that in the example you provided, Book2, when I create new sheet the list of sheets in column AA should be automatically updating? Its not working for me. And I definitely have macros enabled.

    I'm sure there is a way for me to create a VBS to make a dynamic list of sheet names that populate there, so you've definitely got me on the right track. Many thanks!

  8. #8
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: conditional sum across worksheet pages

    Oh F*$%. Wrong sheet attached. Gimme 5 mins to find the right one!!!!!!!
    Last edited by Glenn Kennedy; 07-06-2015 at 02:13 PM.

  9. #9
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,986

    Re: conditional sum across worksheet pages

    A really blonde/senior moment. I was working on two very similar threads - yours and another. In my tiny, befuddled mind I was getting the two confused. In this sheet, the formulae are set up for sufficient sheets to fil the pale green cells. If you need more, adjust the ranges in the formulae and the Named Ranges approproately.

    Hopefuly.... this is it now. Sorry for making you doubt your sanity!!!!!
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 07-06-2015 at 03:01 PM.

  10. #10
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    Re: conditional sum across worksheet pages

    I'll take a look later when I get a free moment. I'm glad I'm not loony! Thank you!!!

  11. #11
    Registered User
    Join Date
    07-02-2015
    Location
    Gainesville, FL
    MS-Off Ver
    2010
    Posts
    6

    Re: conditional sum across worksheet pages

    Yessssss!!!!!!! Thank you!!!! :-D

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Conditional Formatting between pages
    By robholding in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2014, 11:21 AM
  2. Conditional Formatting over multiple pages
    By ineedthisspread in forum Excel General
    Replies: 7
    Last Post: 12-18-2012, 05:53 AM
  3. HELP!! Create Multiple Pages within a worksheet from another worksheet
    By ItsAllBee in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-31-2012, 10:41 AM
  4. Replies: 2
    Last Post: 02-05-2011, 10:35 AM
  5. Conditional formatting from separate pages
    By HuskerBronco in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 01-25-2008, 08:35 AM

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