+ Reply to Thread
Results 1 to 6 of 6

Thread: Inserting row numbers

  1. #1
    Registered User
    Join Date
    01-09-2012
    Location
    India
    MS-Off Ver
    Excel 2000
    Posts
    3

    Unhappy Inserting row numbers

    Hi,

    For the below example data:

    521358 abc
    521358 abc
    521358 abc
    524536 ddd
    564325 ddd

    I want insert row numbers as

    1 521358 abc
    521358 abc
    521358 abc
    2 524536 ddd
    3 564325 ddd
    564325 ddd

    Please look in an help me

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2009
    Location
    San Francisco, CA
    MS-Off Ver
    Excel 2003, 2007, 2010
    Posts
    986

    Re: Inserting row numbers

    I kinda just made it up. But assuming all your data are in column B starting row 1

    in A1 enter =COUNTIF($A$1:A1,A1)
    in A2 enter =IF(COUNTIF($A$1:A2,A2)<>1,"",COUNT($B$1:B1)+1)
    To thank someone who has helped you, click on the star icon below their name.

    I hate reading

    Portfolio

    I need a job.
    I am young and incompetent

  3. #3
    Registered User
    Join Date
    01-09-2012
    Location
    India
    MS-Off Ver
    Excel 2000
    Posts
    3

    Re: Inserting row numbers

    While applying this formula, it is not assigning number continuously, like

    40 511167842
    511167842
    42 511178251

    Instead of assigning 41 next to 40, it is calculating blank row and assigning next as 42.

    My data starts from row# B2...

  4. #4
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,226

    Re: Inserting row numbers

    If your numbers start in B2, put this formula in A2, then copy down:

    =IF(COUNTIF($B$1:$B2,$B2)=1, MAX($A$1:$A1)+1, "")
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

  5. #5
    Registered User
    Join Date
    01-09-2012
    Location
    India
    MS-Off Ver
    Excel 2000
    Posts
    3

    Re: Inserting row numbers

    Great guys, it works... thanks for your support

  6. #6
    Forum Guru JBeaucaire's Avatar
    Join Date
    03-21-2008
    Location
    Bakersfield, CA
    MS-Off Ver
    2010
    Posts
    19,226

    Re: Inserting row numbers

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    “None of us is as good as all of us” - Ray Kroc
    “Actually, I *am* a rocket scientist.” - JB (little ones count!)

+ 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