+ Reply to Thread
Results 1 to 9 of 9

Sum multiple defined named ranges using wildcards.

  1. #1
    Registered User
    Join Date
    09-13-2010
    Location
    Florida, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Sum multiple defined named ranges using wildcards.

    I am trying to figure out a way to create a sum for named ranges using a wildcards as part of the name. The data I am working on has specific parameter data for different sites. For instance, the defined name ranges look as follows:

    Plant1_Downtime
    Plant2_Downtime
    -
    -
    Plant50_Downtime

    I would like to sum all of these ranges without having to enter individual defined names into a SUM equation. Ideally I'd like to be able to do something like the following:

    =SUM("*_Downtime")

    Unfortunately this gives me #VALUE error.

    Does anyone know of a way to accomplish this?

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Sum multiple defined named ranges using wildcards.

    There is not a way to operate on names using wildcards, but there may be another way to meet your goal. How is your data organized, and how do these names refer to data? For example, if each name refers to the same range on a different sheet for 50 different sheets, there may be a way to do this other than by using the names.

    Also, do you need to do this for other names, or just the one?

    It would be very helpful if you could attach your file.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

  3. #3
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sum multiple defined named ranges using wildcards.

    I don't think you'll be able to get wildcards work on Named Range references.

    But if you can put a list of the range names in a range of cells, then you can do something like this

    =SUMPRODUCT(SUMIF(INDIRECT(A1:A10),"<>0"))

    A1:A10 is a list of VALID Named ranges to sum.

  4. #4
    Registered User
    Join Date
    09-13-2010
    Location
    Florida, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sum multiple defined named ranges using wildcards.

    Thanks for the reply 6StringJazzer. Unfortunately I can't include the file as it has some company data in it. However, I will provide a little more detail in response. The data is pulled from a SQL Reporting Services cube into a pivot table on a single worksheet. All of the data is located on this single worksheet and the named ranges apply to individual columns. I did find several solutions for using the same named range on different worksheets but that won't work for me. I searched several sites before posting this but couldn't find anything that would help. Must be because it is not possible to do. At least not without a macro......
    Last edited by scott.millsaps; 10-03-2016 at 02:17 PM.

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple defined named ranges using wildcards.

    I can't think of a way to use wildcards.

    However, you could try this method:

    =SUMPRODUCT(SUMIF(INDIRECT("Plant"&ROW(INDIRECT("1:50"))&"_Downtime"),"<>0"))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple defined named ranges using wildcards.

    NB...

    If the names are dynamic names created using functions like OFFSET then this will not work!

  7. #7
    Registered User
    Join Date
    09-13-2010
    Location
    Florida, USA
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Sum multiple defined named ranges using wildcards.

    Thanks to Jonmo1 and Tony Valko. Looks like SUMPRODUCT is the way to go. I think this will get me where I need to be. Everyone's help is much appreciated.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sum multiple defined named ranges using wildcards.

    You're welcome.

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sum multiple defined named ranges using wildcards.

    You're welcome. Thanks for the feedback!

+ 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] VBA to accept pasting current named ranges into defined ranges
    By phpolicylady in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-01-2015, 01:33 PM
  2. Referring to Named Ranges defined with OFFSET()
    By jaskamakkara in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-20-2013, 03:55 AM
  3. Replies: 2
    Last Post: 01-03-2013, 01:29 AM
  4. Index Function with Named/Defined Ranges
    By cosco in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 07-27-2010, 03:12 PM
  5. Replies: 0
    Last Post: 02-11-2010, 08:05 AM
  6. User Defined Functions: can control what named ranges get used?
    By djt76010 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-21-2008, 08:26 PM
  7. [SOLVED] Reviewing a list of defined named ranges
    By Barb Reinhardt in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-21-2006, 01:05 PM

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