+ Reply to Thread
Results 1 to 4 of 4

SUMPRODUCT with Range Determined by Formula

  1. #1
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    SUMPRODUCT with Range Determined by Formula

    Hi,

    In cells B2, B6 and B10 I have formula that calculates weighted-average growth rates per country.

    The formula works in such a way that the weighted average excludes products in a country for which the Growth Rate is "n/a".

    When creating the formula for each country I have manually selected the data range for each. However, in reality the table has far more countries and products than in my sample.

    Can someone please suggest how to adjust the formula in B2 so that it will use the country indicated in column D to decide which products to include in the calculation for each country, rather than me having to select the range for each country?

    Thanks!
    Attached Files Attached Files
    Last edited by andrewc; 01-28-2020 at 03:34 PM.

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: SUMPRODUCT with Range Determined by Formula

    It's not ideal to have the formulas in the same column as the data. That will generate circular references if the formula is meant to look at the whole column.

    My suggestion is to use a helper column with the following formula, for example in F2, copied down.

    Please Login or Register  to view this content.
    Then you can use a simple
    Please Login or Register  to view this content.
    Now you would still have to manually copy and paste that formula into the rows with the totals. Not ideal.

    You may want to consider using Pivot Tables to avoid such messy manual interaction.

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

    Re: SUMPRODUCT with Range Determined by Formula

    In a separate column (Not ideal to use Column B) use in Row 2

    =IF(D2="",SUMPRODUCT(--(D$3:D$13=A2),B$3:B$13,C$3:C$13/SUMIFS(C$3:C$13,D$3:D$13,A2,B$3:B$13,"<>"&"n/a")),"")

    Copy all the way down
    Last edited by Ace_XL; 01-27-2020 at 04:40 PM.
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  4. #4
    Forum Contributor
    Join Date
    02-08-2005
    MS-Off Ver
    Microsoft 365
    Posts
    810

    Re: SUMPRODUCT with Range Determined by Formula

    Thanks very much!

+ 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] Chart data range determined by formula.
    By minionan in forum Excel Charting & Pivots
    Replies: 2
    Last Post: 09-09-2019, 03:36 AM
  2. Formula to total cell values within a range determined by combination of other cells.
    By Victorthesecond in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-16-2018, 01:17 PM
  3. need help setting formula in cell with a changing range determined by a combobox
    By kevinu in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-15-2018, 04:24 PM
  4. Replies: 2
    Last Post: 08-07-2015, 12:42 AM
  5. getting a count of values in a range where the range is determined by a lookup
    By AMurderOfCrows in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-25-2015, 11:17 AM
  6. [SOLVED] SUM range determined by INDEX?
    By Butcher1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-21-2014, 01:02 PM
  7. [SOLVED] Construct a formula on a pre-determined cell for a pre-determined duration of cells
    By Shaun Gemiver in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 01-03-2013, 11:14 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