+ Reply to Thread
Results 1 to 4 of 4

number increment skipping blanks

  1. #1
    Registered User
    Join Date
    09-02-2007
    Posts
    2

    number increment skipping blanks

    Hi,
    I have data coming into A1:A20000.
    In the B column, data is checked and marked L if criteria are met.
    In the C column I want to number consecutively, rows were B column is marked L.
    Example:

    x......A…….B.....C
    1…..123
    2…..123
    3……52 …..L…..1
    4…..123
    5…..123
    6…..123
    7……52…..L…...2
    8…..123
    9……52…..L…...3
    10….52…..L…...4

    I can get C column to return 1 easy enough, but how do I increment the numbers by 1, skipping the blank rows?
    I could use Max+1 but I restart the count daily (about 1000 rows),
    I manually restart the count with 1 and would like the following numbers to increment by 1, if possible.

    Thank you, Brandy

  2. #2
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Hi brandyw,

    This will do the counts for you, put this in C1:

    =IF(B1="","",COUNTIF($B$1:B1,"L"))

    How you plan to restart the numbering I'm not so sure, since placing a 1 into any cell in column C will overwrite the formula. You could, of course, change the formula as needed from $B$1 to the cell next to where you put a 1 in column C. So if you restart with 1 in C891, in B891 simply change the formula to
    =IF(B891="","",COUNTIF($B$891:B891,"L"))

  3. #3
    Registered User
    Join Date
    09-02-2007
    Posts
    2
    Hi Paul,
    Thank you for your reply,
    I have tried a few of those types of formulas, but they require an adjustment every day.
    There’s a formula out there that counts consecutively while skipping blanks.
    I came across it a few months ago while researching for another excel formula, except I didn’t mark the page and of course now that I can use it I can’t find it.
    I didn’t look at it very long and just can’t remember the approach it took.
    At least I get to learn more about Excel, while searching.
    I would restart the count by putting in a 1 over the formula, on the first instance for a new day of data, eventually having the formula check for new day and restart count automatically.

    Thank you again for your quick response,
    Brandy

  4. #4
    Valued Forum Contributor
    Join Date
    08-31-2007
    Location
    SW Ireland
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20068) 32-bit
    Posts
    523
    Not sure if this is what you want but it might give you an idea of what might work:

    In cell C1 only:

    Please Login or Register  to view this content.
    In cell c2 (and copied to subsequent cells):

    Please Login or Register  to view this content.
    Last edited by deadlyduck; 09-03-2007 at 06:23 PM.

+ 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