+ Reply to Thread
Results 1 to 12 of 12

IF with AVERAGEIFS returning #Value

  1. #1
    Registered User
    Join Date
    12-22-2023
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    48

    IF with AVERAGEIFS returning #Value

    Hi all!

    Figured I needed to explain what I try to achieve - thanks for your feedback Glenn.
    If the value in C is 0 I want to the 3 above 3 cells in D.
    Further, I want to include the project name as there are multiple project names in the column and I only want average for the project mentioned on the row I type the formula.


    I don't understand why cell D13 is returning #Value.
    In my opinion it should take average of the 3 cells above.

    Can someone please provide me some feedback.

    Thank you
    Attached Files Attached Files
    Last edited by varbergt; 01-11-2024 at 06:34 AM. Reason: More explaination

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,054

    Re: IF with AVERAGEIFS returning #Value

    A non-working formula and not much of an explanation of wht you REALLY want. So, a guess:

    =AVERAGE(TAKE(FILTER(C2:C12,B2:B12=B13),-3))

    This averages the last 3 values in C2:C12, where the value in B2:B12 equals the value in B13.

    You may need ; instead of ,
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: IF with AVERAGEIFS returning #Value

    You need to amend the formula in D4 to this:

    =IFERROR(IF(C4<>0,C4,AVERAGEIFS(D1:D3,B2:B4,B4)),"")

    (Note that you had it with B$2), then copy this down. You can't copy it above as you don't have enough cells.

    Hope this helps.

    Pete

  4. #4
    Registered User
    Join Date
    12-22-2023
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    48

    Re: IF with AVERAGEIFS returning #Value

    I like the idea. The problem is still when going from one project to another. Then AVERAGE is also calculated based on the other project's numbers. Enclosing the issue.Sample Data.xlsx

  5. #5
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,903

    Re: IF with AVERAGEIFS returning #Value

    In future, please make full disclosure in the OPENING post of the thread instead of tacking extra requirements on as the thread progresses.
    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.

  6. #6
    Registered User
    Join Date
    12-22-2023
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    48

    Re: IF with AVERAGEIFS returning #Value

    Hi Ali, project name is also mentioned in the OPENING post. I assume this is what you are referring to.

  7. #7
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,903

    Re: IF with AVERAGEIFS returning #Value

    Your sample workbook attached to the opening post was NOT fully representative, was it?

    Please be guided - it will save your helpers time in the long run.

  8. #8
    Registered User
    Join Date
    12-22-2023
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    48

    Re: IF with AVERAGEIFS returning #Value

    That's a very good pointe. Thank you.

  9. #9
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,732

    Re: IF with AVERAGEIFS returning #Value

    What do you think the answer in D16 should be?

    At the moment it is taking the average of C13:C15 because B14:B16 are all equal to B16. Perhaps you should make the ranges on column C the same as for column B, rather than them being offset by 1 cell.

    Hope this helps.

    Pete

  10. #10
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,903

    Re: IF with AVERAGEIFS returning #Value

    Is this what you want?

    =IF(C2=0,AVERAGE(TAKE(FILTER(C$1:C1,B$1:B1=B2),-3)),C2)
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-22-2023
    Location
    Denmark
    MS-Off Ver
    365
    Posts
    48

    Re: IF with AVERAGEIFS returning #Value

    This is brilliant! Just what I needed!
    Thank you.

  12. #12
    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. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,903

    Re: IF with AVERAGEIFS returning #Value

    Glad to have helped.

    If you have not already done so, you may not be aware that you can thank anyone who offered you help towards a solution for your issue by clicking the small star icon (* Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of each of those who offered help.

+ 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] AVERAGEIFS RETURNING #DIVO! message
    By chriswrcg in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-16-2019, 07:45 AM
  2. [SOLVED] AVERAGEIFS returning #DIV/0!
    By MoldyBread in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-22-2019, 08:30 AM
  3. [SOLVED] Averageifs function not returning correct average
    By CSherman in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-02-2017, 11:11 PM
  4. Need help with averageifs function - keeps returning #DIV/0
    By JAWilliams in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-26-2015, 01:38 AM
  5. [SOLVED] Averageifs returning #DIV/0 error
    By kbotta in forum Excel General
    Replies: 8
    Last Post: 10-09-2014, 08:38 AM
  6. [SOLVED] Averageifs returning DIV/0 errors even though there are values
    By lifeseeker1019 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-12-2013, 02:19 AM
  7. Averageifs returning Value?
    By katja328 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-08-2009, 06:20 PM

Tags for this Thread

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