+ Reply to Thread
Results 1 to 4 of 4

Calculations based on Filtering

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

    Calculations based on Filtering

    Hi,

    I have a table of data from which I am trying to create a dynamic report where a weighted average growth rate can be calculated that depends on the filtering.

    I have attached an example in which you’ll notice that the weighted average growth rate of all of the products is -0.90%. What I would like to be able to do is, for example, to filter on the “Long-Term” items in the “Category” column and have the weighted average growth rate calculated just for those items. Clearly the weights will change as a different set of “Values” are involved in the calculation.

    Can someone please suggest the best way to go about achieving this.

    Thanks!
    Attached Files Attached Files

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

    Re: Calculations based on Filtering

    In E2

    =C2/SUBTOTAL(9,$C$2:$C$11)*B2

    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Forum Expert Fotis1991's Avatar
    Join Date
    10-11-2011
    Location
    Athens(The homeland of the Democracy!). Greece
    MS-Off Ver
    Excel 1997!&2003 & 2007&2010
    Posts
    13,744

    Re: Calculations based on Filtering

    Do you mean?

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

    Fotis.

    -This is my Greek whisper to Europe.

    --Remember, saying thanks only takes a second or two. Click the little star * below, to give some Rep if you think an answer deserves it.

    Advanced Excel Techniques: http://excelxor.com/

    --KISS(Keep it simple Stupid)

    --Bring them back.

    ---See about Acropolis of Athens.

    --Visit Greece.

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

    Re: Calculations based on Filtering

    @ Fotis

    =SUMPRODUCT($C$2:$C$11/(SUBTOTAL(9,$C$2:$C$11)),$B$2:$B$11)

    will give you incorrect results since the entire range C2:C11 and B2:B11 will be considered whilst the divisor will be only the filtered results

    An alternative would be to not go down the filter route. Input the selection (Long, medium or short term) in a separate cell, say A15. Then use

    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] Coordinate based calculations
    By Sparkplug90 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-06-2013, 04:23 PM
  2. [SOLVED] Filtering and generating new tabs based on Unique values based in column
    By amlan009 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2012, 09:40 PM
  3. Replies: 3
    Last Post: 03-04-2010, 01:11 PM
  4. Dynamic calculations for cost when filtering
    By Zyphon in forum Excel General
    Replies: 4
    Last Post: 10-05-2007, 04:21 PM
  5. calculations based upon months
    By fascal in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-11-2006, 02:20 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