+ Reply to Thread
Results 1 to 6 of 6

Thread: How to create a repeat set of sequence number index where values appear in a row

  1. #1
    Registered User
    Join Date
    01-26-2012
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    How to create a repeat set of sequence number index where values appear in a row

    Hi,

    It's hard to explain what I want to achieve so I apologise if I confuse you here. I've included a sample excel (attached) and highlighted what I want to achieve in red.

    I have a set of data in excel and I want to insert a new column A to contain a numeric index but I would like the numbers to repeat if that row contains any values, otherwise, if the row is completely empty, then that row index is blank or has a symbol/zero (doesn't matter). The next row containing values, the index would then contain the next number.

    That was terrible, sorry. Here's another example of what i'm trying to achieve:

    A B C D
    1 word word
    1 word word
    1 word
    1 word
    1 word
    *
    2 word word
    2 word word
    2 word
    2 word
    2 word
    *
    3 word word
    3 word word
    3 word
    3 word
    3 word


    Hope that helps.
    Thanks!
    Attached Files Attached Files
    Last edited by tiggi; 01-28-2012 at 03:30 AM.

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

    Re: How to create a repeat set of sequence number index where values appear in a row

    Try this in A5
    =IF(COUNTA(B5:F5)=0,"",MAX($A$4:$A4)+1)
    Drag/Fill Down

    Is that what you need?
    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.

  3. #3
    Registered User
    Join Date
    01-26-2012
    Location
    australia
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: How to create a repeat set of sequence number index where values appear in a row

    Wow! I can't get enough of this site! Thanks so much for the speedy response - you're formula is soooo close but not quite. Refer to the attachment, this is what I'm after. Thanks again!!
    Attached Files Attached Files

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

    Re: How to create a repeat set of sequence number index where values appear in a row

    Okay.
    In A4
    1
    Then in A5
    =IF(AND(A4<>"",COUNTA(B5:G5)>0),MAX($A$4:$A4),IF(AND(A4="",COUNTA(B5:G5)>0),MAX($A$4:$A4)+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
    Forum Guru martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    10,771

    Re: How to create a repeat set of sequence number index where values appear in a row

    in a4 assuming single blanks are only between sets in col g
    =IF(G4="","",1+COUNTIF($G$4:G4,""))
    Last edited by martindwilson; 01-28-2012 at 08:19 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and a dabbler in Cisco
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

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

    Re: How to create a repeat set of sequence number index where values appear in a row

    @Martin Neat!

    @ tiggi
    If you only have one seperating blank row between groups, go with Martin.
    My offering will work if there can be, or are, more than one seperating blank rows between groups.
    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.

+ 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