+ Reply to Thread
Results 1 to 8 of 8

Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

  1. #1
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    I am trying to calc employee hours in a summary tab across multiple "project" tabs. The criteria is to lookup the name across multiple tabs (30+), but allow the user to modify the number of tabs, add/delete, rename, etc. Also, the "project" tabs cannot require that the employee name is always in the same cell (but the range of cells is structured). I have used macro SUMIF3D2, it worked well. However, it appears that this macro is causing instability in the excel file, causing it to crash.

    My question is whether a simplified equation exists that can do the same thing exists? I have used varying ideas with SUMPRODUCT, INDIRECT, DYNAMIC range, but each requires the number of tabs to remain static, i need this to be variable. For instance, the following: =SUMPRODUCT(SUMIF(INDIRECT("'"&PROJECTS2&"'!"&"B:B"),B5,INDIRECT("'"&PROJECTS2&"'!"&"H:H"))), works but only if the tab range "PROJECTS2" remains fixed. As new project tabs are added by user, I need the equation to automatically include the new tab, or allow to add/delete tabs. Only the Macro seems to accommodate all this criteria, but some users are experiencing volatility. Can you help?

  2. #2
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    Sorry, this is my first post and just getting the hang of it. Hope it goes well...

  3. #3
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    Attached is working file, the tab "util" is the relevant sheet for the question thanks
    Attached Files Attached Files

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    Hi Charles and welcome to the forum,

    If you must have the VBA answer then you need to learn that Sheets.Count is the number of sheets. If you do a loop through all sheets using a For..Next.. loop you can get all new sheets. Something like:

    Please Login or Register  to view this content.
    The other possible answer is to use Power Query and append all the tables in the workbook. I'm not sure you have PQ available in your version of "2019 office 265" as I've never heard of that.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  5. #5
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    Many thanks. Is there a solution that does not require a VBA? An equation that will allow the sheets to vary?

  6. #6
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    I could still use some help on this problem. Let me start again. I'd like to simplify my approach without using a macro. In attached sheet "UTILIZ", in column B, I have employee names. In Col F, I want to return the total hours that employee worked in Jan for all the PROJECTS between tab 'START' to 'END", where employee name is in range of B30-B59, and hours are recorded in H30-H59 (for Jan). I'm trying to get an equation that will read each PROJECT tab between START:END, sum the hours for that particular employee, and return to UTIL Col F. I tried this approach:

    =SUMPRODUCT(SUMIF(INDIRECT("'"&START&"'!"&":"&"'"&END&"'!"&"B:B"),B5,INDIRECT("'"&START&"'!"&":"&"'"&END&"'!"&"H:H")))

    but it gives me a #NAME? return, which I assume is due to the fact excel is unable to understand START:END in the indirect approach.

    I also grouped the current tab names under name range "PROJECTS2" and applied: =SUMPRODUCT(SUMIF(INDIRECT("'"&PROJECTS2&"'!"&"B:B"),B5,INDIRECT("'"&PROJECTS2&"'!"&"H:H")))

    This works fine, except the TAB name range does not allow the user to add new PROJECT tabs in the future, the name range must remain static for this equation to work. The goal of this approach is to allow PROJECT tabs to be added without changing the UTILIZ tab equation.

    Any additional help would be greatly appreciated. BTW I have Office 365, but I am not advanced enough to use Power Query.
    Attached Files Attached Files

  7. #7
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    Hi Charles,

    I've been studying your workbook for about a half hour trying to decide what I'd do with it. First, a few questions: Do workers have the same rate across different jobs? How do you bill and collect? Is it on the 19th of each month?

    In general having so many tabs is a bad idea. You also have 3 different tables on each tab, that isn't what I'd do. Is it possible to have a Tab for lists like: Job Table, Employee Table and on a second sheet have worked hours with dates? This might eliminate all the tabs and be much more useful. Then if you had dollars out, as negative numbers and dollars in as positive you could sum dollars to see where you were with each job. I think a better understanding of Tables and seeing what Filtering, sorting and Pivots can do for you would be productive.

    Here is an example that looks too hard for me, but might give you some ideas.
    https://www.officetimeline.com/project-management/excel

    I'd like to see a better use of simple tables in your work. Here are 10 different ideas using Excel:
    https://www.thewindowsclub.com/free-...ates-for-excel

  8. #8
    Registered User
    Join Date
    07-23-2019
    Location
    Houston, Texas
    MS-Off Ver
    2019 office 265
    Posts
    6

    Re: Calculating Sumifs Across Multiple Tabs; allowing Tabs to change or be added/deleted

    M - Thanks very much for feedback. Firstly, a worker has same internal raw rates but different billing rates across projects (depends on client), billing and collection is done separately (AJERA), this is not intended as a collection/billing tool rather a mgt forecasting tool to estimate future profit on each project, which rolls up to divisional performance (in the future).

    Background: The PROJECT sheets are no doubt over complicated. The goal of this workbook is to allow a div mgr (5 DIV USERS) to assess (estimate) the profitability of a division building the results of each project (causing the undesirable, multiple PROJECT tabs), therefore, the Project tabs have three sets of table to enable an individual project to be analyzed for the sole purpose of profitability, namely, schedule of revenue/invoicing (monthly), cost of labor (we are a labor only business), then the cost of subconsultant (outside labor costs). Granted, the subconsultant (outside) costs can certainly be moved out of these tabs, but I left them in to complete the net costs per project.

    Since the sum of all PROJECT tabs allows the div mgr to evaluate DIV profit in the future (DIV SUMMARY - not shown), it is nice to keep each Project data together in a unified tab - it helps tracking accuracy over time. However, this is creating my problem, since I cannot estimate now the number of future projects (TABS) or names as they will be added in the future.

    This is basically a forecasting mgt tool, we don't use it for actual billing purposes. But it has helped the mgr's get control on predicted schedule of revenue & costs at the project level, which is critical for us. The structure can be improved and streamlined, I am reviewing your suggestions, but the goal is the same.

    So, this all works ok for us, but I wanted to add a feature that would capture the labor hours across all the projects - ie UTILIZ tab (and new projects (tabs) added in the future - which is my current problem in the indirect approach). However, at the moment, with 5 div mgrs each with their own workbook, I wanted to complete the operation of UTILIZ more efficiently. The macro (module1), as you can see, is doing the job...but at the cost of processing time.

    Summary, i'd like to keep the basic structure the same for now and capture the total labor hours across projects (to check over/under utilization quickly) with a better approach. Perhaps there is not one. It appears that INDIRECT will not work with 3D arrays for a SUMIF application. Is there another workaround other than manhandling the data in each tab, then vlookup in the UTILIZ summary??

    Please let me know if you have any suggestions. I'll look at rebuilding the entire structure later on. Best regards - C

+ 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. Replies: 1
    Last Post: 10-30-2018, 05:22 AM
  2. [SOLVED] Help with sumifs formula across multiple tabs
    By hmcarter2007 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-19-2017, 10:53 PM
  3. Replies: 0
    Last Post: 09-12-2016, 02:02 PM
  4. Replies: 45
    Last Post: 03-12-2015, 12:46 PM
  5. Error in SUMIFS across multiple tabs
    By mavericky10 in forum Excel General
    Replies: 1
    Last Post: 01-07-2015, 09:19 AM
  6. Error in SUMIFS across multiple tabs
    By mavericky10 in forum Excel General
    Replies: 1
    Last Post: 01-05-2015, 04:15 PM
  7. Is there a code that will add rows to multiple tabs when added to the first tab?
    By OUNate in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2012, 06:38 PM

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