+ Reply to Thread
Results 1 to 6 of 6

Reset counter for equal to and more than 0

  1. #1
    Registered User
    Join Date
    06-12-2018
    Location
    England
    MS-Off Ver
    365 (Latest)
    Posts
    2

    Reset counter for equal to and more than 0

    I am looking for a little help here. I'm not a novice, but I am not an expert either. Just need to resolve one issue. I will include as much info as I can during my explanation.

    I am trying to make a "days since" tracker that shows the days since someone has delivered a certain thing. (not using dates just week numbers).

    I have most of a formula set up and ready to go just need to tweek it a little and I cannot figure it out.

    in the final box, 0=7 and 1 resets the counter. Heres the formula;

    =IFERROR(COUNTIF(INDEX(A4:BB4,LOOKUP(2,1/(C4:BB4=1),COLUMN(C4:BB4))):BB4,0)*7,COUNTIF(C4:BB4,0)*7)

    I need to reset when it detects any number 1 and above, not just 1. How can I edit this to do that and not lose everything that it currently does.

    (Here is the table so far and you can see the issue on the Sutton Coldfield row, where the days since should be 7)

    123.PNG

  2. #2
    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,869

    Re: Reset counter for equal to and more than 0

    Will you please attach a sample Excel workbook? We are not able to work with or manipulate a picture of one and nobody wants to have to recreate your data from scratch.

    1. Make sure that your sample data are REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    2. Make sure that your desired results are also shown (mock up the results manually).

    3. Make sure that all confidential data is removed or replaced with dummy data first (e.g. names, addresses, E-mails, etc.).

    4. Try to avoid using merged cells as they cause lots of problems.

    Unfortunately the attachment icon doesn't work at the moment, so to attach an Excel file you have to do the following: just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.

    Please pay particular attention to point 2 (above): without an idea of your intended outcomes, it is often very difficult to offer appropriate advice.
    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.

  3. #3
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Reset counter for equal to and more than 0

    Just a guess,

    C4:BB4=1

    The last non 0 value in the sutton coldfield row is not equal to 1, so this part of the formula is not recognising it, perhaps changing that section to C4:BB4>0 will help.

  4. #4
    Registered User
    Join Date
    06-12-2018
    Location
    England
    MS-Off Ver
    365 (Latest)
    Posts
    2

    Re: Reset counter for equal to and more than 0

    Hopefully the work book is attached. If I change to >0 it returns 0 regardless of values so this does not work. The formula I have also ignores blanks. If anyone can figure it out I would be most grateful. It also doesn't necessarily need to be >=1. as long as it recognises 1, 2, 3, 4 and 5 I can work with that because in the 10 years I have been doing this no one has done more than 5. So a between 1 and 5 line would work if anyone can get it to return what I need it to.

    All the days since cells are fine, the error occurs on the Sutton Coldfield line where it doesn't reset the counter when it detects a 2. So the formula needs to be changed in that cell to detect 1-5 as reset triggers, the field should say 7.
    Attached Files Attached Files
    Last edited by Darkestvalkryie; 06-12-2018 at 02:36 PM. Reason: Missing information in post

  5. #5
    Forum Expert
    Join Date
    06-08-2012
    Location
    Left the forum!
    MS-Off Ver
    Left the forum!
    Posts
    5,189

    Re: Reset counter for equal to and more than 0

    Not sure what you did, but I just changed =1 to >0 in your sample file and it looks fine.

    Sutton Coldfield row change to 7, the rest of the results stay the same.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Reset counter for equal to and more than 0

    FWIW:

    This works, too.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Dave

+ 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: 1
    Last Post: 08-20-2014, 05:45 PM
  2. For loop counter reset
    By amphinomos in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-03-2014, 10:59 AM
  3. Reset Counter when a date is entered into various cells
    By asinara88 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-16-2013, 07:26 AM
  4. Counter reset
    By BN-CD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-13-2007, 04:56 PM
  5. Counter Reset??
    By loh69 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 09-28-2006, 07:39 AM
  6. [SOLVED] Reset Counter
    By Ed in forum Excel General
    Replies: 3
    Last Post: 04-14-2006, 12:40 PM
  7. [SOLVED] How to Reset Workbook Counter?
    By Joseph Geretz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-03-2006, 01:55 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