+ Reply to Thread
Results 1 to 8 of 8

AVERAGE (IF()) not working

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

    AVERAGE (IF()) not working

    Hi,

    anyone please help me.

    both below code not working

    AVERAGE(IF((H515:IW572=H503)*(H519:IW576={"January","February"},H524:IW581))) CRTL + SHIFT + ENTER
    AVERAGE(IF((H515:IW572=H503)*(H519:IW576={"January";"February"},H524:IW581))) CRTL + SHIFT + ENTER


    but this one is ok

    where M502= January, M502= February

    =AVERAGE(IF((H515:IW572=H503)*((H519:IW576=M502)+(H519:IW576=M503)),H524:IW581)) CRTL + SHIFT + ENTER


    Please help.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: AVERAGE (IF()) not working

    Try the AVERAGEIFS() function...

    Also, your ranges need to be the same size
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: AVERAGE (IF()) not working

    Hi,

    The comma vs semicolon determines if it is a Horizontal or Vertical array constant. Read
    http://www.databison.com/excel-array...ray-constants/
    And look at the section of Horizontal and Vertical Array constants. Squint to see "," vs ";" which is the difference.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

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

    Re: AVERAGE (IF()) not working

    Hi marvinP & FDibbins,

    Thanks for reply. both not working, i dont know where is the wrong syntax? but the 3rd formula working fine. can u please help to make correction
    Last edited by Faridwahidi; 05-16-2014 at 12:58 AM.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: AVERAGE (IF()) not working

    Does

    =AVERAGE(IF((H515:IW572=H503)*((H519:IW576="January")+(H519:IW576="February")),H524:IW581)) CRTL + SHIFT + ENTER

    work?

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: AVERAGE (IF()) not working

    maybe you missed the close parentheses in your syntax

    ......*(H519:IW576={"January","February"}here
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

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

    Re: AVERAGE (IF()) not working

    Hi MarvinP,

    =AVERAGE(IF((H515:IW572=H503)*((H519:IW576="January")+(H519:IW576="February")),H524:IW581)) CRTL + SHIFT + ENTER working fine



    Hi vlady,

    what do you means by close parentheses in my syntax? it seems to be correct formula.
    AVERAGE(IF((H515:IW572=H503)*(H519:IW576={"January","February"},H524:IW581))) CRTL + SHIFT + ENTER




    Please also help me in VBA code if more than one criteria in the same range to be counted
    http://www.excelforum.com/excel-prog...ria-range.html

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

    Re: AVERAGE (IF()) not working

    Hi MarvinP,

    I have replied on the above, It works for
    =AVERAGE(IF((H515:IW572=H503)*((H519:IW576="January")+(H519:IW576="February")),H524:IW581)) CRTL + SHIFT + ENTER

    but on this formula not
    AVERAGE(IF((H515:IW572=H503)*(H519:IW576={"January","February"},H524:IW581))) CRTL + SHIFT + ENTER


    Please help, thanks.

+ 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] Working out an average for the best 8
    By Cmorgan in forum Excel - New Users/Basics
    Replies: 6
    Last Post: 07-02-2012, 05:33 AM
  2. average not working
    By mtsf in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-05-2011, 04:53 AM
  3. Average function not working
    By mattandbenny in forum Excel General
    Replies: 3
    Last Post: 08-26-2011, 03:54 PM
  4. Average formula not working when I know it should
    By TheNameless122 in forum Excel General
    Replies: 3
    Last Post: 07-15-2010, 08:10 AM
  5. Working the average
    By Pjcan1 in forum Excel General
    Replies: 3
    Last Post: 11-30-2009, 10:27 AM

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