+ Reply to Thread
Results 1 to 4 of 4

AVERAGEIFS & Named Ranged Inputted Criteria

  1. #1
    Registered User
    Join Date
    09-06-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    12

    AVERAGEIFS & Named Ranged Inputted Criteria

    Hi there! Struggling excel novice. I have a spreadsheet that has 2 tabs. "Input" to display results, and a "Data" tab. On the input tab I have a selection area to input zipcodes to match criteria from the "data" tab. I'm trying to then calculate the average population for multiple zipcodes based upon those chosen on the Input tab. Additionally, my data has different dates for the population statistics, though only want to grab the latest population.

    I was able to use this formula to calculate the average, though I have to manually input the zip codes into the formula. I need this to calculate based on zipcodes selected on my "Input" screen automationally.

    Here's the formula I was able to use that worked with inputting the zipcodes within the formula:
    =SUMPRODUCT(SUMIFS(Data!D:D,Data!A:A,"201306",Data!B:B,{"08085","08084","07001","07002","07003"}))/SUMPRODUCT(COUNTIFS(Data!A:A,"201306",Data!B:B,{"08085","08084","07001","07002","07003"}))


    I'm trying to use a formula like below, which has a Named Range on the "Inputs" screen to choose the zip codes automatically:
    =SUMPRODUCT(SUMIFS(Data!D:D,Data!A:A,"201306",Data!B:B,ZIPCODES))/SUMPRODUCT(COUNTIFS(Data!A:A,"201306",Data!B:B,ZIPCODES))

    D Column = Population Stats
    A Column = Date of Population Stats (201306)
    B Column = Zip Codes

    Attached is also a sample of my spreadsheet. Thank you in advance for any help you can provide!
    Attached Files Attached Files

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

    Re: AVERAGEIFS & Named Ranged Inputted Criteria

    It can't process a non-contiguouse range

    You have ZIPCODES referring to B2 D2 F2 H2 etc..

    You need to arrange the values of the named so they are contiguouse (B2 B3 B4 etc..)
    And the named range can simply refer to B2:B5

    Even if you need to create a new column for that..

    Say
    A20 =B2
    A21 =D2
    A22 =F2
    A23 =G2

    then make ZipCodes refer to A20:A23

  3. #3
    Registered User
    Join Date
    09-06-2012
    Location
    New Jersey
    MS-Off Ver
    Excel 2010
    Posts
    12

    Re: AVERAGEIFS & Named Ranged Inputted Criteria

    Thank you! That is great!!!

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

    Re: AVERAGEIFS & Named Ranged Inputted Criteria

    You're welcome

+ 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. sumproduct on named ranged giving #VALUE! error
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-08-2011, 10:02 PM
  2. Lookup Two Named Ranged
    By yawnzzzz in forum Excel General
    Replies: 3
    Last Post: 09-24-2010, 03:10 PM
  3. How to ignore emptry rows in a named/ranged table
    By ebbo in forum Excel General
    Replies: 0
    Last Post: 06-01-2009, 11:34 AM
  4. Changing a named ranged based on array size on a form
    By Wanderer in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-27-2006, 08:15 AM
  5. Replies: 2
    Last Post: 06-01-2005, 01:05 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