+ Reply to Thread
Results 1 to 16 of 16

Count upward then once certain number reached reset back to 0

  1. #1
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Count upward then once certain number reached reset back to 0

    Good evening everyone

    I was wonder if anyone can help me with this formula

    =COUNTIF(A:A,A3)

    In colum A I have a list of Ids that often repeat so I used that formula to count them. Now what I am wanting to do is make it so after the Id has been counted up to 4 it resets back to 0 and starts counting again..
    What would I need to add to that formula to make it count all the repeated Ids to 4 then reset to 0 and start counting again I am new to excel..

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

    Re: Count upward then once certain number reached reset back to 0

    Hi and welcome
    although we value privacy as much as anyone else, it could be important that members have a rough idea of your location. You might in the future post questions which are bound to your regional settings.
    So, please update your profile to something more precise then "Uknown" ( country will suffice, no need to be more precise).
    Thank you for helping us to help you

  3. #3
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    I updated the info

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

    Re: Count upward then once certain number reached reset back to 0

    Thanks a lot

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    Your explanation is not clear. Take the name QQQ. First time in list =1 then 2nd, 2; 3rd, 3; 4th, 4; 5th zero (as you stated) or 1 again???
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    If you REALLY meant start again at zero;

    =MOD(COUNTIF($A$2:A2,$A2),5)

    and if you REALLY mrant start again at 1:

    =1+MOD(COUNTIF($A$2:A2,$A2)-1,4)
    Last edited by Glenn Kennedy; 09-20-2019 at 02:51 AM.

  7. #7
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Smile Re: Count upward then once certain number reached reset back to 0

    =COUNTIF(A:A,A3)
    I drag down the formula so it applies to all colums in colum A..

    I am gonna try a few of the reccomended formulas
    Last edited by aleross; 09-20-2019 at 02:59 AM.

  8. #8
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    It worked your formulat Thank you very much.. for your help

  9. #9
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    Quote Originally Posted by Glenn Kennedy View Post
    If you REALLY meant start again at zero;

    =MOD(COUNTIF($A$2:A2,$A2),5)

    and if you REALLY mrant start again at 1:

    =1+MOD(COUNTIF($A$2:A2,$A2)-1,4)
    your solution worked..

  10. #10
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

  11. #11
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    Glenn Kennedy I like your formula solution I have one last question is it possible to make it say a word like FREE after counting to 4 For example 1,2,3,4,Free as the last entry before it starts to count again?

    Both your examples worked =1+MOD(COUNTIF($A$2:A2,$A2)-1,4) and =MOD(COUNTIF($A$2:A2,$A2),5) I just was wondering if its possible to replace the 0 with the word Free then it starts counting back up again?

  12. #12
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    Yes. In B2, copied down:

    =IFERROR(1/(1/MOD(COUNTIF($A$2:A2,$A2),5)),"Free")

  13. #13
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    Quote Originally Posted by Glenn Kennedy View Post
    Yes. In B2, copied down:

    =IFERROR(1/(1/MOD(COUNTIF($A$2:A2,$A2),5)),"Free")
    Last question I copied it down your formula It works but It shows "Free" in all the colums even the ones that dont have data and I just want it to show "Free" when its the 4th one.

  14. #14
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    Yep:

    =IF(A2="","",IFERROR(1/(1/MOD(COUNTIF($A$2:A2,$A2),5)),"Free"))

  15. #15
    Registered User
    Join Date
    09-14-2019
    Location
    Mexico
    MS-Off Ver
    Windows 10
    Posts
    17

    Re: Count upward then once certain number reached reset back to 0

    Quote Originally Posted by Glenn Kennedy View Post
    Yep:

    =IF(A2="","",IFERROR(1/(1/MOD(COUNTIF($A$2:A2,$A2),5)),"Free"))

    Thank you works man your fast..

  16. #16
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Count upward then once certain number reached reset back to 0

    Have to... most of my work has been involved in responses to a certain type of emergency!!

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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: 4
    Last Post: 12-12-2018, 12:34 AM
  2. Running total until a max is reached, then reset
    By debmassa in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-04-2018, 05:53 PM
  3. [SOLVED] How to count *backwards* the number of blank cells until a number reached
    By lamlam28 in forum Excel Formulas & Functions
    Replies: 19
    Last Post: 05-06-2018, 11:34 PM
  4. [SOLVED] Count Number of Cells Until a Value is reached
    By yabastud in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 12-02-2016, 12:58 PM
  5. Count up to a number, then back down to 1, then back up
    By leafs4life22 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-07-2013, 09:11 PM
  6. [SOLVED] Character Count Until a Number is Reached
    By HangMan in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-07-2012, 09:48 AM
  7. setting an set number of 41 and having it reset to 0 once 41 is reached
    By the_spc_four82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-13-2011, 03:50 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