+ Reply to Thread
Results 1 to 31 of 31

Averageifs formula no longer working

  1. #1
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Averageifs formula no longer working

    Hi
    I am encountering a rather puzzling issue: I updated a file I created in Oct with November sales and 2 of my formulas are no longer working: "averageifs" and "index match" coupled with "max".
    The file is the same format as before just added a new list, the formulas are exactly the same but I just get "0" everywhere except on the first line.

    And yes just in case anybody is wondering I have put the "{}" signs for the array formula.
    Can anybody help please?
    Marieme

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    Quote Originally Posted by Marieme View Post
    And yes just in case anybody is wondering I have put the "{}" signs for the array formula.
    What exactly do you mean by that? Did you type them in by hand?
    and Why? Avererageifs and Index/Match formulas do not require {array entry}

    Can you post a sample of the book?

  3. #3
    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,933

    Re: Averageifs formula no longer working

    Have you checked to make sure that he "values" are actually numbers and not text that just looks like a numner?
    Test with =ISNUMBER() on a few of them - FALSE indicates text
    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

  4. #4
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Hi FDibbins
    That was my first check.
    Jonmo1 no I didn't enter them manually but through ctl+shift+enter not for the averageifs but rather for the "index match max if" formula.

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    Can you post a sample of the book?
    Or at least show us the formulas?

  6. #6
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    here is one on the formulas
    ($K3-$D3)*IFERROR(AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$Y:$Y;CONCATENATE($B3;$C3);Invoice_List_RTM_test_2606!$F:$F;">="&$A3;Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3);0)][/COLOR]
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    here is one on the formulas
    ($K3-$D3)*IFERROR(AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$Y:$Y;CONCATENATE($B3;$C3);Invoice_List_RTM_test_2606!$F:$F;">="&$A3;Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3);0)][/COLOR]
    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Jonmo1
    I suspect it has to do with the "Invoice..." sheet because when I open the Oct file and use that same sheet as the reference sheet it works.
    I would like to share a sample file with you but I'd would have to make a lot of changes since it has confidential info and I am afraid of corrupting the file rendering it useless for you.

  9. #9
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    And the other formula causing trouble
    =IFERROR(INDEX(Invoice_List_RTM_test_2606!$B:$B;MATCH(MAX(IF(Invoice_List_RTM_test_2606!$T:$T=Stock!$J3;IF(Invoice_List_RTM_test_2606!$F:$F<=Stock!$H3;Invoice_List_RTM_test_2606!$F:$F)));IF(Invoice_List_RTM_test_2606!$T:$T=Stock!$J3;Invoice_List_RTM_test_2606!$F:$F);0));0)*K3
    Please Login or Register  to view this content.

  10. #10
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    Possible causes for that formula (from post #7) to return 0
    1) K3-D3 = 0

    2) The result of the Averageifs function is an error (therefor trapped by IFERROR, and returning 0)
    a) Possible cause for error in averageifs, Errors pre-existing in any of the referenced ranges
    b) Or There are no numeric values in the Average Range corresponding to rows where the criteria are all met.
    c) None of the rows met all of the criteria

    3) The result of the Average just happens to be 0
    a) Cause of this is there are both positive and negative numbers in the average range) corresponding to rows where the criteria are all met.
    b) Or All numbers in average range are 0 corresponding to rows where the criteria is met


    I'd say the most likely cause is either 2b or 2c


    My first step for troubleshooting would be to remove the IFERROR, and the (K3-D3) parts, and test only the averageifs by itself.
    If still 0, then you likely have 0's in the average range (or mix of positive and negative numbers and the average happens to be 0).
    If you get Div/0 error, then you have either no numeric values in the average range, or none of the rows met the criteria.
    If you get some other error like #N/A or #Value!, then that error likely exists in one of the other ranges referenced by the formula.

    Start testing it with 1 criteria at a time.

    Which of these return the correct results, which don't?
    AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$Y:$Y;CONCATENATE($B3;$C3))
    AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;;Invoice_List_RTM_test_2606!$F:$F;">="&$A3)
    AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3)

    Repeat each of the above, but use COUNTIF instead and remove the average range..
    Last edited by Jonmo1; 12-16-2014 at 03:38 PM.

  11. #11
    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,933

    Re: Averageifs formula no longer working

    TYpe some ot the function results in manually, and see where it breaks down? Something like this...
    INDEX(Invoice_List_RTM_test_2606!$B:$B;MATCH(10;Invoice_List_RTM_test_2606!$F:$F)
    I used 10 for the MAX)IF() part, you would use something that works for you

    edit: I think jonmo and myself are using the same approach

  12. #12
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Tried the step by step approach as suggested: taken separately there is no problem, the break down happens when I put them together. Apparently it is cause 2c of Jonmo options. What I don't understand however is this problem did not occur last month (this is a listing of all invoices made since January 2014).

  13. #13
    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,933

    Re: Averageifs formula no longer working

    OK, so you broke the big formula down into it's component parts, and each 1 gave a valid answer.

    Now manually enter those answers into the "big" formula and see if it works. If not, then test to make sure than numbers being returns (and then used in a search) are actually numbers
    Remember that concat returns text, not numbers
    CONCATENATE($B3;$C3)

  14. #14
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    I'd stop thinking about why it worked last month but not this month.
    Ultimately at this point it doesn't matter, it doesn't narrow down the list of possible causes.
    It's only giving you a headache.
    Once the cause is discovered, the why will probably make itself known.

    So each formula using 1 criteria resulted in expected values?

    Now try doing 2 criterias..
    You have a total of 3 criterias, so do 1 formula for 1 and 2, another for 1 and 3, and another for 2 and 3.
    Does that help narrow it down?


    Try using the AutoFilter for each criteria so you can actually see which rows do and do not meet each criteria...


    Also, still in the back of my head..I noticed both formulas you posted from post #7 & #9 refer to K3...a commonality??
    What does =$K3-$D3 return?
    Last edited by Jonmo1; 12-16-2014 at 04:19 PM.

  15. #15
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Sorry FDibbins and Jonmo I should have specified that after doing each separately , I combined them as in Jonmo's last post and that's when I noticed that it is when criteria 3 is mixed with another than I get #Div/0 (into the "big" formula without the iferror).
    K3 and D3 are volume.

  16. #16
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Averageifs formula no longer working

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  17. #17
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    Criteria 3 being...
    Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3
    ??

    But when you did that criteria by itself...
    =AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3)
    You DID get a valid result? not an error?


    OK, then it appears there is nothing actually wrong with the formula or the data.
    It just so happens that NONE of the rows actually meet all the criteria this month..
    And the formula is indeed returning the correct result of 0

  18. #18
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Quote Originally Posted by Jonmo1 View Post
    It just so happens that NONE of the rows actually meet all the criteria this month..
    I do believe the formula is correct and there are rows that do meet the criteria; the problem is that even the previous months yield 0 everywhere (hence the reason I kept refering to the previous month).

  19. #19
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    It's time to post a sample book.

  20. #20
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    I think so. Lemme see how I can tweak my file without making a lot of mess

  21. #21
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    There is one other thing I found odd about the formula, but I've ignored it because you said it worked as desired in previous months...
    ($K3-$D3)*IFERROR(AVERAGEIFS(Invoice_List_RTM_test_2606!$B:$B;Invoice_List_RTM_test_2606!$Y:$Y;CONCATENATE($B3;$C3);Invoice_List_RTM_test_2606!$F:$F;">="&$A3;Invoice_List_RTM_test_2606!$F:$F;"<="&Stock!$H3);0)

    Criteria 2 compares column F to A3 without any sheet reference to A3, so it refers to the sheet the formula is on
    Criteria 3 compares the same column F to Stock!H3.

    It's peculiar that the same column would be compared against 2 different criterias from 2 different sheets.

    It's quite possible that was intentional and is supposed to be that way.
    it's just one thing that stands out...

  22. #22
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Ok here is a sample book.
    Attached Files Attached Files

  23. #23
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    You might want to trim that down some more, and double check the formula after you 'cleaned' the sheet.
    We really only need about 10 rows or so of formulas and reference data.

    You have the formula checking column Y for CONCATENATE($B3;$C3)
    But on the reference sheet, column Y is empty.

    AFter looking, it seems you probably meant for that to be looking in column M
    But, there are no values in column M that match the result of the concatenate..


    I'm out of time for today, but I'll try to pick it up some more tomorrow.

  24. #24
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Hi Jonmo
    Sorry I've been travelling all day. Just got to a place where I could check emails and stuff.
    I'll look at the file asap; it's true that I did the sample late last night, tired and deleting stuff that I deemed irrelevant and didn't check the formulas after.

  25. #25
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    Cleaned up version; my apologies for the mess!
    And now it seems like I am getting values for my index match... function
    Attached Files Attached Files

  26. #26
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    That looks like it's still the same file.
    Formula on the Stock Sheet L2
    =($J3-$D3)*IFERROR(AVERAGEIFS(Invoice_List_RTM_test_2606!$A:$A,Invoice_List_RTM_test_2606!$Y:$Y,CONCATENATE($B3,$C3),Invoice_List_RTM_test_2606!$F:$F,">="&$A3,Invoice_List_RTM_test_2606!$F:$F,"<="&Stock!$G3),0)

    It's looking at column Y for matches to the concatenate function
    But column Y on the Invoice sheet is empty.

    It's looking for dates in column F that are between 2 given dates.
    But there are no dates in column F of the Invoice sheet.

  27. #27
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    ooooohhh looks like the lack of sleep is really catching up with me.
    I re-attached last night's file, sorry about thet.
    Here is the right one
    Attached Files Attached Files

  28. #28
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    The problem is 2c as described in Post #10

    ok, on the stock sheet, L3, Formula is
    =($J3-$D3)*IFERROR(AVERAGEIFS(Invoice_List_RTM_test_2606!$A:$A,Invoice_List_RTM_test_2606!$M:$M,CONCATENATE($B3,$C3),Invoice_List_RTM_test_2606!$D:$D,">="&$A3,Invoice_List_RTM_test_2606!$D:$D,"<="&Stock!$G3),0)

    Now that's searching column M from the Invoice sheet for matches to CONCATENATE($B3,$C3)
    The result of CONCATENATE($B3,$C3) is "3306130cl RGB x 24"
    The value "3306130cl RGB x 24" does not exist in column M of the Invoice sheet.
    So the Averagifes formula returns Div/0! Error (because there are 0 rows that meet ALL the criteria).
    Iferror traps that error and returns 0.
    Formula returns 0.


    Hope that helps.

  29. #29
    Registered User
    Join Date
    11-24-2014
    Location
    Dakar
    MS-Off Ver
    2010
    Posts
    21

    Re: Averageifs formula no longer working

    I do not get since the value "30cl RGB...3 does exist. Even if it doest exist for customer B3 on 31st July, there is value at an earlier date.
    Furthermore column K which has the index match function is now returning values on the sample sheet but not on my original book.

  30. #30
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Averageifs formula no longer working

    as jonmo1 says where does that exist 3306130cl RGB x 24 when joined with customer number in column M? of Invoice_List_RTM_test_2606 column m only contains 30cl RGB x 24
    column m of Invoice_List_RTM_test_2606 says concatenate as a header but there is no concatenation in there
    surely column m of that sheet should be =C2&L2 or=concatenate(C2,L2)

  31. #31
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Averageifs formula no longer working

    Quote Originally Posted by Marieme View Post
    I do not get since the value "30cl RGB...3 does exist.
    But like I said, the formula is NOT looking for "30cl RGB x 24"
    It's looking for the result of CONCATENATE($B3,$C3)
    And the result of that concatenate function is "3306130cl RGB x 24"
    That value does not exist in column M of the Invoice Sheet.

    As Martin pointed out, column M of the Invoice sheet probably used to contain a concatenate function as well, but it's not there in the book you posted.

+ 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. Array formula no longer working
    By CarlABC_116 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-07-2013, 02:38 PM
  2. [SOLVED] Macro no longer working?
    By Margate in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 02:26 PM
  3. [SOLVED] trying to take averageifs and ignore the blank cells, not working
    By cgabe001 in forum Excel General
    Replies: 2
    Last Post: 12-27-2012, 10:19 AM
  4. Excel 2007 : AVERAGEIFS formula not working
    By milliemoo in forum Excel General
    Replies: 5
    Last Post: 03-07-2012, 09:19 AM
  5. vba web query no longer working
    By Cicada in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-21-2011, 07:56 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