+ Reply to Thread
Results 1 to 7 of 7

AVERAGEIF Vs AVERAGE(IF()) not return the same result

  1. #1
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    AVERAGEIF Vs AVERAGE(IF()) not return the same result

    Hi,

    Can anyone explain why these two approaches has not return the same result. AVERAGE(IF()) has returned the wrong result.

    =AVERAGEIF(F13:F63,"Officer",SZ13:SZ63)

    {=AVERAGE(IF(F13:F63="Officer",SZ13:SZ63))}

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    In my simple testing, they report the same result. Can you post a sample workbook, your real one desensitized or a fake book with the same layout and data style, that demonstrates these two formulas showing different results?
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    Hi JBeaucaire,

    Attached herewith sample of my workbook. What went wrong with my data layout?
    Attached Files Attached Files

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

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    The AVERAGE(IF treats the blank cell as a zero; AVERAGEIF ignores it.

    A
    B
    C
    D
    E
    F
    1
    Bob A1: Blank
    0.5
    E1: {=AVERAGE(IF($A$1:$A$2="Bob", $B$1:$B$2))}
    2
    Bob
    1
    A2: Input
    1
    E2: =AVERAGEIF($A$1:$A$2, "Bob", $B$1:$B$2)
    Last edited by shg; 09-01-2014 at 01:56 PM.
    Entia non sunt multiplicanda sine necessitate

  5. #5
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    .....and if you want to get the same result use this version of the array formula

    =AVERAGE(IF(F13:F63="Officer",IF(SZ13:SZ63<>"",SZ13:SZ63)))

    that filters out the blanks to get the same result as AVERAGEIF
    Audere est facere

  6. #6
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    Hi shg,

    Thanks a lot. I have tried these but it has returned zero result

    {=AVERAGE(IF(AND(F13:F63="Officer",SZ13:SZ63=">0"),SZ13:SZ63))]}

    {=AVERAGE(IF(AND(F13:F63="Officer",SZ13:SZ63>0),SZ13:SZ63))}

  7. #7
    Valued Forum Contributor
    Join Date
    03-28-2014
    Location
    Kuala Lumpur, Malaysia
    MS-Off Ver
    Excel 2016
    Posts
    696

    Re: AVERAGEIF Vs AVERAGE(IF()) not return the same result

    Hi daddylonglegs,

    Thanks a lot. it works fine

+ 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. AVERAGEIF - calculate monthly average
    By TheRobsterUK in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-05-2014, 11:53 AM
  2. [SOLVED] AVERAGEIF Formula Different then Excel Average
    By Winfield in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 04-30-2013, 09:13 PM
  3. Removing #DIV/0! from Averageif result
    By nickelcell1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-14-2011, 12:28 AM
  4. Another Average or AverageIf Issue
    By scarames in forum Excel General
    Replies: 6
    Last Post: 08-18-2009, 11:09 AM
  5. FALSE result from Averageif formula
    By ren1104 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 04-17-2007, 08:28 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