+ Reply to Thread
Results 1 to 18 of 18

Can you help with excel forumlas not executing properly?

  1. #1
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Question Can you help with excel forumlas not executing properly?

    Hello,

    Please could anyone advise on what may be causing this error, and how to solve it.
    I have a table of totals separated by month over a financial year. The forumla is as such for each month is as follows:

    =SUMIFS($D$3:$D$1000,$I$3:$I$1000,"Complete",$L$3:$L$1000, ">=01/06/2019",$L$3:$L$1000, "<01/07/2019")

    This simply sums up the values from complete orders within a date range.

    However, sometimes all the values calculate into the month of December. And if I do a find and replace on = to = it updates and all the values go where they should be.

    1.PNG
    2.PNG
    3.PNG



    Thank you.
    Last edited by AliGW; 10-31-2019 at 04:39 AM. Reason: Solved tag added - no need to edit thread title or add solved to post. Thanks.

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    The formula looks Okay but is your calculation set to automatic or manual?
    If the result is incorrect and you press F9, does it update?
    In this case see and check if calculation is set to Automatic (General Options)
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    Hey - yes it is set to automatic.

    And more strangely I have 5 tabs which are duplicates (apart from data) and it only happens on some of them, some of the time.

  4. #4
    Forum Expert PaulM100's Avatar
    Join Date
    10-09-2017
    Location
    UK
    MS-Off Ver
    Office 365
    Posts
    2,108

    Re: ERROR - Bizarre formula behaviour

    Change the formula to a sumproduct and see if acts like that

    =SUMPRODUCT(($I$3:$I$1000="Complete")*($L$3:$L$1000>="01/06/2019")*($L$3:$L$1000<"01/07/2019"),$D$3:$D$1000)

    But most likely it has something to do with the calcuations set to manual. Maybe you have a macro that turns them off?
    Click the * to say thanks.

  5. #5
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    Check (if present) personal macro book

  6. #6
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    Thank you Paul. I will try SUMPRODUCT and see if this reoccurs.

    I'm confident there is no macros. But what steps could I take to assure this?

  7. #7
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    See attached image

    Attachment 645509

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    mcuzz: your attachment is invalid. Open VBA editor and see if there are macros, if personal macro book is present it will show-up in the VBA projects windows

  9. #9
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    Hello - please see attached image. I have clicked into each object and they're all without any code.

    Attachment 645510

  10. #10
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    Attachment is still (at least for me) invalid. please attach the default forum way

  11. #11
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    Sorry! I didn't realise you couldn't see the image. I thought you meant invalid as in not want you needed to see.


    4.PNG

    5.PNG

  12. #12
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    How about the personal macro book? Somewhere along the line something happens.
    Are you sure the calculation is set to automatic and no exclusion for tables and so?

  13. #13
    Forum Expert
    Join Date
    05-01-2014
    Location
    California, US
    MS-Off Ver
    Excel 2010
    Posts
    1,795

    Re: ERROR - Bizarre formula behaviour

    Quote Originally Posted by mcuzz View Post
    =SUMIFS($D$3:$D$1000,$I$3:$I$1000,"Complete",$L$3:$L$1000, ">=01/06/2019",$L$3:$L$1000, "<01/07/2019")
    First, it would be "better" (more flexible) if you wrote the formula as follows:

    =SUMIFS($D$3:$D$1000,$I$3:$I$1000,"Complete",$L$3:$L$1000, ">="&DATE(2019,6,1),$L$3:$L$1000, "<"&DATE(2019,7,1))

    As you wrote it, your formulas would sum "Complete" entries only on Jan 6 (i.e. between midnight Jan 6 and midnight Jan 7) on my computer, because 1/6/2019 would be interpreted in the form MDY instead of DMY.

    Second, however, I do not see how your formula would work when copied down TCV or SOV columns, since the dates are hardcoded.

    If the month names Apr, May etc are entered into column A, I suggest that you enter dates in the form (DMY) 1/4/2018, 1/5/2018 etc, formatted as Custom mmm to display only the month name (abbreviated).

    Then your formula can be:

    =SUMIFS($D$3:$D$1000,$I$3:$I$1000,"Complete",$L$3:$L$1000, ">="&$A3,$L$3:$L$1000, "<="&EOMONTH($A3,0))

    That assumes that you have only dates, not times of day, in column L.

    I cannot say if that would correct your problem. Probably not. But it certainly simplifies formulas and makes them less error-prone.

    Off-hand, I see no reason why your formula would behave as you describe, except: (a) the cell format was Text originally, in which case you would see the actual formula, not merely a (old?) sum for Dec only; or (b) the calculation mode is Manual, or (very unlikely) the worksheet calculation is disabled (in VBA).

    So, unless and until you can attach an Excel file that demonstrates the problem, I cannot help you.

    PS.... I cannot see any good reason to change to a SUMPRODUCT formula. And SUMIFS is much more efficient.

  14. #14
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: ERROR - Bizarre formula behaviour

    True, and as this post is going, we're all basing our options/answers on text and explanations. a file with actual values will clear matters.
    The OP is running Office 365, myself and others 2016 and last 2010, so all options can be checked.

  15. #15
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,462

    Re: ERROR - Bizarre formula behaviour

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)

  16. #16
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: ERROR - Bizarre formula behaviour

    Hello everyone.

    Thank you for your support so far. I will make the suggested changes to my dates. As this problem only seems to occur infrequently - next time it does I will save a copy and attach it to this thread.

    Just for clarity each month the formula is modified accordingly. So in jan row it is >=01/01/2019 and <01/02/2019, and feb >=01/02/2019 and <01/03/2019 etc

  17. #17
    Registered User
    Join Date
    10-16-2019
    Location
    Newcastle
    MS-Off Ver
    365
    Posts
    8

    Re: Can you help with excel forumlas not executing properly?

    Hi everyone.

    Wanted to let you know the bug seems to have been solved by changing the date from a string to a date object

    01/03/2019 is now DATE(2019/03/01)


    Thanks!

  18. #18
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,916

    Re: Can you help with excel forumlas not executing properly?

    Great, good to know.
    Happy coding

+ 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. Updating Links (paths to other workbooks) - Bizarre Behaviour Problems!
    By MathUKTeacher in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-23-2019, 09:15 PM
  2. [SOLVED] Odd Error Handling Behaviour; goes to error handler even when no error?
    By kalikj in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-04-2018, 10:04 AM
  3. Strange formula behaviour, works one day but not the next?
    By tailz in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 08-29-2013, 04:08 AM
  4. excel macro: permission denied (error 70). Strange behaviour
    By kappa85 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 03-08-2013, 08:30 AM
  5. [SOLVED] Error Handling strange behaviour, it only works the first time
    By Henk Stander in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-08-2012, 10:10 AM
  6. [SOLVED] Formula's not working Properly, and acting completely bizarre!
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-04-2012, 01:05 PM
  7. Replies: 5
    Last Post: 11-09-2009, 12:16 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