+ Reply to Thread
Results 1 to 5 of 5

Thread: Reset Numbers Formula

  1. #1
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    10

    Reset Numbers Formula

    I am looking for a formula that resets itself. On each row called Country, it is one in column B. For each non blank row in column C after the country row the number is increased by one. When it comes to the next country row, it goes back to 1 and continues the same formula. The format is not always going to be exactly the same. I am looking for a formula solution.
    Attached Files Attached Files
    Last edited by hiker100; 09-11-2011 at 02:32 PM.

  2. #2
    Valued Forum Contributor MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2010
    Posts
    5,300

    Re: Reset Numbers Formula

    Hi hiker100,

    Try this is C2 and pull it down.
    =IF(LEN(B2)>0,1,C1+1)
    One test is worth a thousand opinions.
    Click the * below to say thanks.

  3. #3
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Reset Numbers Formula

    Thanks. This is very close. This is counting blank rows. For blanks rows, I would like it to be 0.
    It would be one at country, then 2 for the next non blank row and so on.
    How do we just count non blank rows?

  4. #4
    Forum Guru Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    5,593

    Re: Reset Numbers Formula

    Perhaps using a helper say Column E, this can be hidden
    In E2
    =IF(B2<>"",ROW(),"")
    Drag/Fill Down
    In C2
    =IF(B2<>"",1,IF(D2<>"",COUNTA(INDIRECT("$D$"&MAX($E$2:$E2)&":$D"&ROW()))+1,""))
    Drag/Fill Down
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However, if this takes care of your needs, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED. It helps everybody! ....
    Also
    If you are satisfied by any members response to your problem please consider using the small Star icon botom left of thier post to show your appreciation.

  5. #5
    Registered User
    Join Date
    01-25-2010
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Reset Numbers Formula

    Yes, thank you. That works great. I will mark it solved.

+ 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.2.0