+ Reply to Thread
Results 1 to 9 of 9

Need Help finding Error in Formula

  1. #1
    Forum Contributor
    Join Date
    12-13-2011
    Location
    Yorkshire, UK
    MS-Off Ver
    Office365
    Posts
    183

    Need Help finding Error in Formula

    Original message:

    Hi,

    could someone please take a look at the formulas in columns X and Y? I've been staring at it for an hour and cant see why its not working correctly and need a (better) different pair of eyes.

    I suspect its something to do with the date because if I roll A3 back to December 2020, it works. But when I move it forward to January 2021, it breaks with a DIV0 error, even though there is data that should be inrange, essentially looking back on the last 12 month range from the date.


    **Updated**

    What I'm trying to get the formula to do is return a percentage over the previous 12 month date range from the date in A3 to give a 12 month rolling percentage for "Yes" values.

    It looks like its returning a DIV/0 error because there's no data yet for 2021, but I'd like it to still count the valid date for the previous months. Looking at the data on the accident log for 'fabrics' as an example, there are 6/7 'YES' in W and 1/7 in AA so percentages should be 86% and 14% respectively. The formula seems to be ignoring these at the moment due to the date range.


    -------------------------------------------------------------------------------
    Hi,

    could someone please take a look at the formulas in columns X and Y? I've been staring at it for an hour and cant see why its not working correctly and need a (better) different pair of eyes.

    I suspect its something to do with the date because if I roll A3 back to December 2020, it works. But when I move it forward to January 2021, it breaks with a DIV0 error, even though there is data that should be inrange, essentially looking back on the last 12 month range from the date.
    Attached Files Attached Files
    Last edited by AliGW; 01-28-2021 at 07:06 AM.

  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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,040

    Re: Need Help finding Error in Formula

    There are no 2021 dates in column F of the accident log. Try adding one and see what happens!
    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
    Forum Contributor
    Join Date
    12-13-2011
    Location
    Yorkshire, UK
    MS-Off Ver
    Office365
    Posts
    183

    Re: Need Help finding Error in Formula

    Ah, I thought that could be it but I wanted it to still return the value from the previous 12 month date range and ignore that there arent any entries yet for 2021.

  4. #4
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,040

    Re: Need Help finding Error in Formula

    OK - can't help at the mo as I am about to go into a meeting, but I am sure someone else will be able to. Perhaps if you just clarify exactly what results you expect to see? A non-working formula is hard to troubleshoot without knowing the end goal. Thanks!

  5. #5
    Forum Contributor
    Join Date
    12-13-2011
    Location
    Yorkshire, UK
    MS-Off Ver
    Office365
    Posts
    183

    Re: Need Help finding Error in Formula

    Updated the requirements of the formula in first post.
    Last edited by JasonMcQueen; 01-28-2021 at 05:47 AM.

  6. #6
    Forum Expert
    Join Date
    07-06-2004
    Location
    Northern California
    MS-Off Ver
    2K, 2003, 2010, O365
    Posts
    1,490

    Re: Need Help finding Error in Formula

    Replace the 'ACCIDENT LOG'!$F:$F,">="&DATE(YEAR($A$3),1,1) criterion with 'ACCIDENT LOG'!$F:$F,">="&EOMONTH($A$3,-12-(DAY($A$3)<16))+1 to get rolling 12ish month averages.

  7. #7
    Forum Contributor
    Join Date
    12-13-2011
    Location
    Yorkshire, UK
    MS-Off Ver
    Office365
    Posts
    183

    Thumbs up Re: Need Help finding Error in Formula

    My mistake. I only changed the first part of the formula

    Thanks.

  8. #8
    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. 2504 (Windows 11 Home 24H2 64-bit)
    Posts
    91,040

    Re: Need Help finding Error in Formula

    Quote Originally Posted by JasonMcQueen View Post
    Updated the requirements of the formula in first post.
    Jason - don't do that, please - add new or extra information chronologically in the thread, otherwise it becomes very difficult to follow!

    I will restore your original post whilst keeping the new detail.

  9. #9
    Forum Contributor
    Join Date
    12-13-2011
    Location
    Yorkshire, UK
    MS-Off Ver
    Office365
    Posts
    183

    Re: Need Help finding Error in Formula

    No problem. I was just trying to keep it concise.

+ 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] Error with formula - need help finding the error in my formula
    By cabinet12 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-05-2020, 02:53 PM
  2. [SOLVED] Help finding value error
    By Excelski in forum Excel General
    Replies: 10
    Last Post: 10-13-2017, 11:44 AM
  3. [SOLVED] Finding an error in a DNR using VBA
    By ConneXionLost in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-22-2017, 01:26 PM
  4. Formula Error for finding smallest values and index with horizontal cells
    By JoeyscLee in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-05-2017, 12:36 PM
  5. Finding an Error
    By mattman123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2015, 08:16 PM
  6. [SOLVED] Help finding #VALUE! error
    By Cynthia Moore in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-03-2014, 02:10 AM
  7. [SOLVED] Error Match_App Finding error in "cancelled" Excel 2007
    By Excelnoub in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-22-2013, 12:36 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