+ Reply to Thread
Results 1 to 9 of 9

consecutive number counting formula

  1. #1
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    consecutive number counting formula

    In cells v43:v52 I have data which will change often the data is always either a 1,-1 or a 0, I need a way to count from the bottom up and ignore anything that is not part of the chain. It can also contain 0 in rows that are not populated yet but the 0s will always be on the bottom and never in the middle or top.

    I.E. in 3 weeks it could be

    1
    1
    1
    0
    0
    0
    0
    0
    0
    0
    0
    0

    I would want the formula to spit out 3 because it was 1 3 times in a row..

    Now say in week 5 it is
    1
    1
    1
    -1
    -1
    0
    0
    0
    0
    0
    0
    0

    I would want it to spit out -2 because of the 2 "-1" in a row

    Now say we get to week 11
    1
    1
    1
    -1
    -1
    1
    -1
    -1
    1
    1
    -1
    0

    I would want it to spit out "-1" because there was only 1 week with -1 in a row before it went back to 1.



    I need a pro for this one I think.
    Last edited by excelproof; 10-09-2009 at 11:13 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Need help with a consecutive number counting formula

    Try:

    Please Login or Register  to view this content.
    Note: Your sample size would end at V54 if it starts at V43...

    adjust if necessary and then confirm formula with CTRL+SHIFT+ENTER not just ENTER.
    Last edited by NBVC; 10-09-2009 at 09:48 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    Re: consecutive number counting formula

    Thank you for helping, I entered your formula and used CTRL SHIFT ENTER

    I am getting a div/0 error..
    Attached Images Attached Images

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: consecutive number counting formula

    Does this give the error too?

    Please Login or Register  to view this content.
    also, in your jpeg... i don't see { } brackets around the formula.... Did you confirm with CTRL+SHIFT+ENTER so that they do appear?

  5. #5
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    Re: consecutive number counting formula

    New formula works perfectly, thank you very much. Will click the scale and mark it as completed.

  6. #6
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    Re: consecutive number counting formula

    Also I did use the CTRL SHIFT ENTER in the previous, when you click in the cell to edit it it takes away the {}..

  7. #7
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    Re: consecutive number counting formula

    Is there anyway to make this formula look at the just the last 3 numbers in the series of 1, and -1s? So the max streak would be +3 and the least -3?

  8. #8
    Registered User
    Join Date
    11-14-2008
    Location
    In a box
    Posts
    9

    Re: consecutive number counting formula

    Actually nevermind on that, I can filter it in another way. Thanks again for the help.

  9. #9
    Registered User
    Join Date
    11-09-2008
    Location
    South Africa
    Posts
    14

    Re: consecutive number counting formula

    Quote Originally Posted by excelproof View Post
    Actually nevermind on that, I can filter it in another way. Thanks again for the help.
    Hi there Excelproof!

    I don't know if you are still at this address but here's trying.

    Could you please forward me your spreadsheet and maybe just an explanation on how you use/d it? I have been tasked to look at absenteeism and using the Bradford Index although we are looking at a period of 26 weeks in which the absenteeism takes place and it seems what you did will help me a great deal.

    Thanking you in advance,
    Rennier
    South Africa

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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