+ Reply to Thread
Results 1 to 7 of 7

AVERAGEIFS - Correct Formula or other?

  1. #1
    Registered User
    Join Date
    01-14-2020
    Location
    Perth, Australia
    MS-Off Ver
    Office 365
    Posts
    4

    AVERAGEIFS - Correct Formula or other?

    Hi,
    I think I am using the correct formula for my scenario. I definitely need some guidance.

    I need to calculate the average of a range of cells containing different criteria. Attached is a sample of what I am looking for. I think AVERAGEIFS is the formula to use, but could (likely) be wrong.

    =AVERAGEIFS(B2:B7,A2:A7,"CD",A2:A7,"DD1",A2:A7,"DD2")

    The average being displayed in cell F2 in the attached sample file.

    Anyone's help is much appreciated.

    Cheers,
    Ashley
    Attached Files Attached Files

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2503 (Windows 11 Home 24H2 64-bit)
    Posts
    90,235

    Re: AVERAGEIFS - Correct Formula or other?

    Welcome to the forum.

    No, it's not quite right here because the formula wants all the criteria met at once - it's an AND rather than an OPR statement. Try this instead:

    =SUM(AVERAGEIFS(B2:B7,A2:A7,{"CD","DD1","DD2"}))
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    01-14-2020
    Location
    Perth, Australia
    MS-Off Ver
    Office 365
    Posts
    4

    Re: AVERAGEIFS - Correct Formula or other?

    Thanks for the response.
    That formula gives me the SUM of the AVERAGES for the values for CD, DD1, DD2. I need it to show the AVERAGE only of CD, DD1, DD2.

  4. #4
    Forum Expert BMV's Avatar
    Join Date
    01-13-2020
    Location
    St-Petersburg, Russia
    MS-Off Ver
    2013-2016
    Posts
    1,329

    Re: AVERAGEIFS - Correct Formula or other?

    Quote Originally Posted by AliGW View Post
    =SUM(AVERAGEIFS(B2:B7,A2:A7,{"CD","DD1","DD2"}))
    I'm not sure because sum of average is not average such as average of average is not average. But you are right there was AND condition in the AVERAGEIFS function.

    =SUM(SUMIF(A2:A7,{"CD","DD1","DD2"},B2:B7))/SUM(COUNTIF(A2:A7,{"CD","DD1","DD2"}))
    or
    =AVERAGE(IF(ISNUMBER(MATCH(A2:A7,{"CD","DD1","DD2"};)),B2:B7))
    Last edited by BMV; 01-14-2020 at 04:10 AM.

  5. #5
    Registered User
    Join Date
    01-14-2020
    Location
    Perth, Australia
    MS-Off Ver
    Office 365
    Posts
    4

    Re: AVERAGEIFS - Correct Formula or other?

    BMV! That worked!

    Many thanks to you both!

  6. #6
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: AVERAGEIFS - Correct Formula or other?

    In the workbook example that was posted then of course the staightforward = AVERAGE(A2:A7) is sufficient.

    I'm assuming in the production workbook you have values in A & B that you don't want included, and if so when you pose a question please maje sure your sample data accurately reflects your production data.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  7. #7
    Registered User
    Join Date
    01-14-2020
    Location
    Perth, Australia
    MS-Off Ver
    Office 365
    Posts
    4

    Re: AVERAGEIFS - Correct Formula or other?

    Quote Originally Posted by Richard Buttrey View Post
    In the workbook example that was posted then of course the staightforward = AVERAGE(A2:A7) is sufficient.

    I'm assuming in the production workbook you have values in A & B that you don't want included, and if so when you pose a question please maje sure your sample data accurately reflects your production data.
    Thanks for the feedback. I did have have data in my workbook I needed to exclude, and this wasn't reflected in my example. I will take that on board for any future queries.
    Cheers,
    Ashley

+ 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] Help with AVERAGEIFS formula
    By jrtaylor in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-27-2019, 09:16 PM
  2. [SOLVED] Averageifs function not returning correct average
    By CSherman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2017, 11:11 PM
  3. [SOLVED] AverageIFS Formula
    By Verbamore in forum Excel General
    Replies: 5
    Last Post: 02-14-2017, 03:00 PM
  4. [SOLVED] Formula for Predictions League - 3 points correct score or 1 point correct result
    By daveyboy1681 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 08-17-2016, 04:09 PM
  5. Replies: 15
    Last Post: 11-25-2014, 08:14 AM
  6. [SOLVED] The formula is correct but one cell does not return correct value
    By nkhondeya@gmail.com in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-09-2013, 03:08 PM
  7. [SOLVED] Is AVERAGEIFS the correct function to use?
    By IrrepressibleXL in forum Excel General
    Replies: 7
    Last Post: 03-27-2012, 07: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