+ Reply to Thread
Results 1 to 6 of 6

Dynamic named ranges are not woking with SUMIFS function

  1. #1
    Registered User
    Join Date
    10-04-2014
    Location
    Atlanta GA
    MS-Off Ver
    MS office 365
    Posts
    9

    Dynamic named ranges are not woking with SUMIFS function

    Hello Excel Forum:
    My problem is that when I used dynamic named ranges with SUMIFS, I get a #Value! error.
    The SUMIFS works when I use traditional cell references (B15: B26) style. The dynamic named ranges also work for SUM and AVERAGE on the same sheet. So I feel that the dynamic name ranges are correct. When I substitute the named ranges (Dy_Hrs) or (Dy_Fuel) in the SUMIFS function in place of the cell references, I get the error. Once I am convinced that the Dynamic ranges and the SUMIFS work, I want to move to VBA Code. See attached Workbook.

    I am using SUMIFS to add the hours in Range (B15:B26), dynamic range but EXCLUDING the work categories of Contractor, Support, Stripping.

    Any help would be appreciated

    Knightflier
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Dynamic named ranges are not woking with SUMIFS function

    This
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    should probably be this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Like this:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    10-04-2014
    Location
    Atlanta GA
    MS-Off Ver
    MS office 365
    Posts
    9

    Re: Dynamic named ranges are not woking with SUMIFS function

    Hello TMS: Still get the error #value! What I do not understand is the Sum, and Average functions work fine on the same sheet using the same dynamic ranges. When I use the SUMIFS function with normal cell references

    =SUMIFS(B15:B26,D15:D26,"<>" &"Contractor",D15:D26,"<>" &"Stripping",D15:D26,"<>" &"Support",D15:D26,"<>"&"Contractor-Stripping")

    all works as is should. When I substitute a dynamic range name "dy_Hrs" for the B15: B26 range, I get the error #VALUE!

  4. #4
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,607

    Re: Dynamic named ranges are not woking with SUMIFS function

    You're using COUNTA() on columns that have different numbers of used rows. In the sample file,
    Dy_Fuel =OFFSET(Daily_Report!$E$15,0,0, COUNTA(Daily_Report!$E:$E),1) column E has 5 used rows
    Dy_Hrs =OFFSET(Daily_Report!$B$15,0,0, COUNTA(Daily_Report!$B:$B),1) column B has 24
    Dy_Section =OFFSET(Daily_Report!$D$15,0,0, COUNTA(Daily_Report!$D:$D),1) column D has 15

    Try like:
    Please Login or Register  to view this content.
    only the column offset needs to be modified.
    And the last row will be MATCH(9E+303,Daily_Report!$A:$A)
    Last edited by protonLeah; 12-30-2019 at 07:38 PM.
    Ben Van Johnson

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,420

    Re: Dynamic named ranges are not woking with SUMIFS function

    Dy_Fuel
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Dy_Hrs
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Dy_Section
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    Note that the row count in ALL cases is dependent on column A.
    Last edited by TMS; 12-30-2019 at 07:58 PM.

  6. #6
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Dynamic named ranges are not woking with SUMIFS function

    Do you even need the dynamic named ranges? Based on your sheet layout, perhaps use full column references

    =SUMIFS(B:B,D:D,"<>" &"Contractor",D:D,"<>" &"Stripping",D:D,"<>" &"Support",D:D,"<>"&"Contractor-Stripping")
    Life's a spreadsheet, Excel!
    Say thanks, Click *

+ 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] Sumproduct(Sumifs with 2 named ranges
    By Portuga in forum Excel General
    Replies: 3
    Last Post: 08-12-2019, 05:16 AM
  2. [SOLVED] Using OFFSET For Dynamic Ranges Along With SUMIFS?
    By Mvaldesi in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 03-28-2018, 08:53 AM
  3. Replies: 1
    Last Post: 10-07-2015, 07:45 AM
  4. Search function with multiple dynamic named ranges
    By T86157 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-14-2015, 09:27 PM
  5. [SOLVED] Multiple SumIFs with named table ranges
    By Cerenity in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-25-2013, 11:27 AM
  6. [SOLVED] Getting sumifs and dynamic ranges to work together
    By DRFILL in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-05-2012, 11:53 AM
  7. Named ranges-Should I use a dynamic named range
    By foseco in forum Excel General
    Replies: 4
    Last Post: 06-11-2009, 03:56 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