+ Reply to Thread
Results 1 to 9 of 9

More efficient formula request

  1. #1
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Question More efficient formula request

    Hi All!

    I am working on a spreadsheet with multiple columns of information. In one area I need to get an average of percentages, but there are some wrinkles:
    1. The cells are not adjacent to each other
    2. Some cells have a 0 value
    3. Some cells have a -1 value

    I want to get the average of the 6 non-adjacent cells excluding 0 & -1 values

    I came up with the following formula, but there has got to be a better way.
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    There are between 8 and 10 columns between each of the 6 values I am trying to average, below is a simple picture. I can't seem to use AVERAGEIF since that needs a continuous range, unless I am missing some?

    Please let me know if there is a easier, better way to do this and thank you very much for any help you can provide!
    Doug

    Screenshot 2021-04-30 152529.png

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,525

    Re: More efficient formula request

    why can't you use averageif? I used it just trying to reproduce your results and it worked fine. =AVERAGEIF(B3:L3,">0") ignored the columns that were blank.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Re: More efficient formula request

    Hi Sam,

    the AVERAGEIF functions works in the sample I did, but in my actual workbook there are between 8 & 10 columns with information in them (other percentages) between each of the cells I am trying to average and AVERAGEIF won't work here (that I have been able to figure out/test) since it is not a range but several separate cells.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2407 (Windows 11 23H2 64-bit)
    Posts
    83,160

    Re: More efficient formula request

    Your sample workbook needs to properly represent the real data. Sounds like you need to update it so that it's a more realistic representation of what you are working with.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Re: More efficient formula request

    Hi AliGW,

    You are correct, and I am attaching an example workbook for review.

    There are 6 groupings of data (not tables) that show quarterly percentages and at the end a table that averages the percentages per quarter. For each summary quarter (end table) there are 6 inputs (i.e. Q1 Group 1, Q1 Group 2, etc.) which are separated by roughly 9 columns with a mix of text and other percentages (hence not being able to use AVERAGEIF since it works on a range...that I have been able to figure out).

    I have had to come up with a couple of different formulas for averaging with ranges (the formulas can be found in the Annu. columns, the Combined Table, and the Weighted Average table).

    Everything works, I am just looking for input on how to be more efficient if possible.

    Note: The tab in this workbook looks up data from other sheets, I have just copy/pasted values to hopefully stop any connection issues and allow me to clean from private info.

    Thank you all for any help or guidance you can provide.
    Doug
    Attached Files Attached Files

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.86 for Mac MS 365
    Posts
    8,525

    Re: More efficient formula request

    I'm confused looking at your workbook, it doesn't follow with what you wrote in posts 1 or 3 pertaining to text and numbers and 6 to 10 columns to average.
    What I do see is a lot of columns with quarterly data and an annualized column and in the annualized column you appear to be using the averageif formula I mentioned with an iferror portion added.
    Perhaps you could point out where exactly the problem is so I (we) don't have to scroll around the tab looking for your issue?

  7. #7
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,504

    Re: More efficient formula request

    Using row #5 with Qn as criteria to summing and averaging:
    BL6:
    =SUMIF($E$5:$BG$5,BL$5,$E6:$BG6)
    Drag to BL7

    BL12: Averaging row 12, with Qn in row #5 and row12 >0
    =IFERROR(AVERAGEIFS($E12:$BG12,$E$5:$BG$5,BL$5,$E12:$BG12,">0"),0)

    Weighted Average, BR12:
    =SUM(IFERROR(($E$5:$BG$5=BR$9)*$E$9:$BG$9*$E12:$BG12,0))
    Array formula, confirmed with Ctrl-Shift-Enter.
    Quang PT

  8. #8
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Re: More efficient formula request

    Hi Sam,

    I apologize for any confusion I caused. There isn't an issue or problem with what has been done; my inquiry has been if there is a better, more efficient way to accomplish what I am doing. I have the averageif within the groups of data (Spine, Brain, etc.) where I had to come up with the formula in my first post is on the far right combined and summary data since this is taking per question the first 1 value of each group and averaging it (i.e. Spine question 5 quarter 1 + Brain question 5 quarter 1, etc) and since there are columns between these values (roughly 9) with text and other quarterly values I cannot use a range that I know of. If you look at the formulas in the Last group of data (Performance Improvement - COMBINED) you will see the formula I cobbled together, The weighted averages data group also has a formula along similar lines.

    Again, I apologize for any confusion and I really appreciate your time looking at this.
    Doug

  9. #9
    Registered User
    Join Date
    01-07-2018
    Location
    Germany
    MS-Off Ver
    2016
    Posts
    6

    Re: More efficient formula request

    Hi Bebo02999,

    That is amazing!!! This works and is much simpler that what I came up with. If I understand correctly this is working by defining a range for the values, a range for the criteria for the values, and then the specific criteria? I had no idea AVERAGEIFS worked this way; I just focused on a range for the values and overthought myself into something more complex.

    Thank you!!!!
    Doug

+ 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] Find if a request was opened twice or more using duplicates and request date
    By wellous in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 04-22-2020, 05:28 AM
  2. [SOLVED] Does this formula look efficient?
    By Clooney003 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-02-2019, 02:53 AM
  3. Which formula is more efficient?
    By lamdl in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-15-2015, 09:03 PM
  4. Is there a more efficient formula?
    By Uziel in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-25-2011, 05:56 AM
  5. formula help, anything more efficient than 3 IFs?
    By TechRetard in forum Excel General
    Replies: 0
    Last Post: 02-03-2011, 01:17 PM
  6. need more efficient formula
    By tania_del in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2010, 01:06 PM
  7. is there a more efficient formula than...
    By Wazooli in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-24-2005, 03:06 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