+ Reply to Thread
Results 1 to 7 of 7

Count if value is Fail and there are over 10 recorded values within 30 days range

  1. #1
    Registered User
    Join Date
    10-14-2015
    Location
    Perth
    MS-Off Ver
    2010
    Posts
    58

    Count if value is Fail and there are over 10 recorded values within 30 days range

    Hi all

    If someone could help me that would be great.

    I am trying to figure out how to write an IF statement which assesses a specific date and outcome in each cell.

    If the outcome value is "Fail" and there has been a record of 10 or more fails within 30 days of that specific date then assign a 1. If it does not meet these conditions then assign a 0.

    I have attached a worksheet for reference with what I expect should happen. Any help would be great!

    Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    Please try at C2
    =N(COUNTIFS(A$2:A2,"<="&A2,A$2:A2,">="&A2-30,B$2:B2,"Fail")>10)
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    10-14-2015
    Location
    Perth
    MS-Off Ver
    2010
    Posts
    58

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    Thank you for your quick response

    For the most part it works however I notice though at cell B34 where it states "Pass" the formula assigns a 1, this should be a 0.

    Thank you

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    491

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    30 days from 2-Nov = 3-Oct, in that period there are 14 fails, so this is 1.
    Why should it be zero?

    btw - "If there is more than 10 fails in the last 30 days of the specific date then count this as 1, if there is less than count this is a 0" - this instruction is incomplete as it omits what shall happen with exactly 10 fails.

  5. #5
    Registered User
    Join Date
    10-14-2015
    Location
    Perth
    MS-Off Ver
    2010
    Posts
    58

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    Hi thanks for your response

    The reason as to why it should be 0 is because the record was marked as "pass", its only the fails that I am interested in counting.

    To clarify if there are more than fails 10 in the last 30 days then this is counted as 1, if there were exactly 10 then this would be a 10.

    Thank you

  6. #6
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    Please try

    =N(COUNTIFS(A$2:A2,"<="&A2,A$2:A2,">="&A2-30,B$2:B2,"Fail")>10)*(B2="Fail")
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    10-14-2015
    Location
    Perth
    MS-Off Ver
    2010
    Posts
    58

    Re: Count if value is Fail and there are over 10 recorded values within 30 days range

    Hi Bo_Ry

    You have nailed it, this works, thanks so much.

    I always find Countifs' formulas a little strange in the sense that you pass the operators as text strings which I find confusing.

    Thanks again!

+ 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. Replies: 20
    Last Post: 07-28-2019, 04:02 AM
  2. How to make a cell display "FAIL" when range of cells is FAIL
    By crazychile in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-18-2017, 04:13 PM
  3. count days in range
    By namluke in forum Excel General
    Replies: 7
    Last Post: 01-22-2015, 10:33 AM
  4. How to count PASS/FAIL cells in a range...
    By dtvonly in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-12-2014, 12:16 PM
  5. [SOLVED] In a range of days, count how many times one value falls between two other values
    By Araise in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-05-2014, 08:10 PM
  6. Replies: 13
    Last Post: 09-29-2008, 10:36 AM
  7. Calculating time elapsed in days and count days within same range
    By michellem410 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-19-2008, 01:13 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