+ Reply to Thread
Results 1 to 3 of 3

Finding weighted averages without including the cells which are empty in certain rows

  1. #1
    Registered User
    Join Date
    03-29-2020
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Office 365
    Posts
    8

    Finding weighted averages without including the cells which are empty in certain rows

    I have a list of data in which certain cells are empty in a row, but I need to calculate weighted average of each row, so the way I'm going about it is to change weights depending upon whether a cell has a value or not. For example in the first row, where each cell of the data has value, the weight of one particular cell might be 0.2, but in the next row where one of the cells is empty, the weights would reflect that and the new weight would become something like 0.3.

    I've attached a sample notebook with two worksheets, one sheet contains the data for which averages are required and the other sheet contains populations for calculating weights, a sample output is also in the workbook.

    I've tried to attempt this in python but I'm not too adept at pandas and am having a hard time figuring it out.
    Attached Files Attached Files

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: Finding weighted averages without including the cells which are empty in certain rows

    What about in G2:

    Please Login or Register  to view this content.
    Then copy down. Does that give the expected values?

    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    03-29-2020
    Location
    Islamabad, Pakistan
    MS-Off Ver
    Office 365
    Posts
    8

    Re: Finding weighted averages without including the cells which are empty in certain rows

    Dude, this worked perfectly, I was so confused with this one. Thanks, you're a goddamn genius.

+ 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. Replies: 4
    Last Post: 07-19-2019, 04:47 PM
  2. [SOLVED] Averages of nonconsecutive cells including zeros.
    By per11 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 08-23-2016, 02:39 PM
  3. Adjust weighted average (sumproduct) for empty cells
    By robertgroen92 in forum Excel General
    Replies: 3
    Last Post: 03-19-2014, 08:13 AM
  4. Replies: 0
    Last Post: 07-15-2013, 12:00 PM
  5. [SOLVED] Merge rows while taking the weighted averages for the new cell values
    By engineerlady in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-18-2013, 04:10 PM
  6. [SOLVED] find averages not including 0's for values not in contiguous rows or columns
    By jrozendaal in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-14-2005, 11:10 PM
  7. Pivot Tables: How do I show ALL field rows, including empty rows??
    By ekongirl@gmail.com in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-08-2005, 02:06 PM

Tags for this Thread

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