+ Reply to Thread
Results 1 to 7 of 7

Average if for formula outputs

  1. #1
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Average if for formula outputs

    Hi Good Noon All,

    Expecting One more help from you all. I have an existing formula's that gives numeric values. Based on the values I would like to get an average values with criteria.
    Ex: My existing formula (Manually Mocked Up data)
    =(A1*A3+B1*B3+C1*C4+D1*D6+E5*E7)
    Output
    =0+5+10+0+15

    The expected formula will have to average the values by excluding Zero's. So for the above scenario the output will be 10. (30/3). Please help me out. Thanks in advance
    Manikandan Arumugam
    Excel Learner

  2. #2
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Average if for formula outputs

    would something like:

    =AVERAGE(IF(CHOOSE({1,2,3,4,5},A1*A3,B1*B3,C1*C4,D1*D6,E5*E7),CHOOSE({1,2,3,4,5},A1*A3,B1*B3,C1*C4,D1*D6,E5*E7)))
    confirmed with CTRL + SHIFT + ENTER

    work for you?

  3. #3
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Average if for formula outputs

    Thanks for your time, Mate. Will check and get back to you..

  4. #4
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Average if for formula outputs

    Nice Xlent.
    For knowledge enrichment - can you please explain how does your IF formula return FALSE for the zeros in the array?

    Thank you.
    Attached Images Attached Images

  5. #5
    Forum Expert XLent's Avatar
    Join Date
    10-13-2010
    Location
    Northumberland, UK
    MS-Off Ver
    various
    Posts
    2,704

    Re: Average if for formula outputs

    The FALSEs are generated by the IF; in XL any number other than 0 evaluates to TRUE so: IF(number,...) will only return FALSE if number is exactly 0.

    As you infer - you want the individual results to be treated as an array - as we know:

    =AVERAGE(1,2,FALSE) --> 1

    whereas

    =AVERAGE({1,2,FALSE}) --> 1.5

    So, as the pattern of the individual calculations was inconsistent I used CHOOSE to enforce an 'array' of values (such that FALSE is ignored).

    In scenarios where there is a pattern to the calculations the CHOOSE isn't required - e.g. if it were always row 1 * row 3 then you would just use:

    =AVERAGE(IF(A1:E1*A3:E3,A1:E1*A3:E3))
    CTRL + SHIFT + ENTER

    I am sure there are other methods, the CHOOSE option was the first that came to mind.

  6. #6
    Forum Contributor
    Join Date
    02-14-2017
    Location
    India
    MS-Off Ver
    2013
    Posts
    128

    Re: Average if for formula outputs

    Thanks XLent. Its working fine. Thanks Again..

  7. #7
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: Average if for formula outputs

    XLent, thank you very much for the clear explanation!

+ 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. Multiple outputs from a formula
    By trf222 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-01-2020, 09:07 AM
  2. [SOLVED] Is it possible to have 3 possible outputs with an IF/AND formula?
    By Keegan1116 in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 02-21-2020, 12:01 PM
  3. Sorting Formula Outputs
    By Kvothe12 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-22-2016, 02:18 PM
  4. [SOLVED] Weekly average formula (outputs only on last data entry of Sunday)
    By dinker454 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-20-2013, 02:09 AM
  5. [SOLVED] Getting different formula outputs for different given inputs
    By Jay Pee in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 07-12-2013, 04:19 AM
  6. Formula with muliple outputs . . .
    By MichaelJohn33 in forum Excel General
    Replies: 5
    Last Post: 08-15-2009, 05:32 PM
  7. Replies: 2
    Last Post: 02-23-2005, 09:37 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