+ Reply to Thread
Results 1 to 4 of 4

SUMIF and list

  1. #1
    Registered User
    Join Date
    10-23-2014
    Location
    The Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Question SUMIF and list

    Hi,

    I got this sum of SUMIFS:

    Please Login or Register  to view this content.
    As you might guess, from B3 down there's a list of sheetnames and I want to do a SUMIF for the sheets in that list. Right now the only way I could come up with is what's written above. There must be a shorter way, but I haven't got the slightest idea what code I need to use.

    Thanks in advance for the help!

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: SUMIF and list

    Hi, welcome to the forum

    try this approach.
    1. Make a range name for all the sheet names you have in B (I used SumTabs)
    2. Use this formula, adjusted to suite your ranges...
    =SUMPRODUCT(SUMIF(INDIRECT("'"&SumTabs&"'!A6:A1000"),$E5,INDIRECT("'"&Sumtabs&"'!G6:G1000")))

    Try and avoid using entire columns/rows with INDIRECT(), it will start slowing your file down
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    10-23-2014
    Location
    The Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Re: SUMIF and list

    Thanks!

    I tried it:

    Please Login or Register  to view this content.
    It recognizes the datatabs-table, but as result I'm getting a #REF! now. The sum of SUMIF's from the first post does work and it basically does the same.. Any idea why SUMPRODUCT doesn't work?
    Last edited by sklinderman; 10-23-2014 at 04:37 PM.

  4. #4
    Registered User
    Join Date
    10-23-2014
    Location
    The Netherlands
    MS-Off Ver
    2013
    Posts
    4

    Re: SUMIF and list

    I found the problem: some cells in the datatabs-range haven't got a value, which results in Excel searching for sheets that don't have a name, which don't exist, which results in a reference-error.

    So how do I edit this so it checks if the cells have a value? I tried using SUMIFS instead of SUMIF to add a check for value, but I can't get it right.

    Please Login or Register  to view this content.

+ 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. [SOLVED] SUMIF on filtered list
    By NS4Excel in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-22-2021, 05:46 PM
  2. [SOLVED] How to SUMIF name is one from a list.
    By beesus311 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 09-17-2013, 06:26 AM
  3. Sumif with criteria list
    By Brian Barbre in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. Sumif with criteria list
    By KL in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 09-06-2005, 07:05 AM
  5. [SOLVED] List SUMIF
    By Kip in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2005, 08:05 AM

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