+ Reply to Thread
Results 1 to 3 of 3

Taking weighted averages of many different ranges?

Hybrid View

  1. #1
    Registered User
    Join Date
    06-22-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Taking weighted averages of many different ranges?

    Hi there,

    I have little experience with Excel otuside of basic functions so please let me know if what I am trying to do is even possible outside of using a VBA code.

    I have around 10,000+ rows that is sorted by county names. Each county in Row A appears a different number of times, for example, County A may appear 5 times in Row A while County B appears 10 times. Each county has a price and quantity sold associated with it. For example, County A(1) has $500 and 2 units and County A(2) has $1000 and 3 units.

    Ideally, there is a function that would allow me to take weighted averages of each counties price given the quantity that can take into account that some counties repeat a different number of times. Attached is an example of what I am aiming to do.

    Thanks!
    Attached Files Attached Files

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Taking weighted averages of many different ranges?

    H3 and copy down,

    =SUMPRODUCT(($A$3:$A$14=F3) * ($B$3:$B$14=G3), $C$3:$C$14, $D$3:$D$14) / SUMIFS($D$3:$D$14, $A$3:$A$14, F3, $B$3:$B$14, G3)
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    06-22-2012
    Location
    Indiana, USA
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Taking weighted averages of many different ranges?

    Wow, I saw variations of that formula many times when Googling but didn't think it would work.

    Thanks so much! Worked like a charm.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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