+ Reply to Thread
Results 1 to 6 of 6

Sequential number within excel

  1. #1
    Dev
    Guest

    Sequential number within excel

    Please see the data below

    a b c
    000000080672 EI0G18 1.00
    EIVH38 1.00
    EIVK38 1.00
    000000082585 EIRH69 1.00
    EIRK69 1.00

    the first 3 items in column B belongs to the first item in column a.
    Accordingly the next 2 items in col "b" belongs to the next item in col "A".
    I want to number the first item in col "A" as 1 and the 3 items in col "B" as
    1.1, 1.2 1.3 and accordingly, the next item in col "a" as number 2 and
    accordingly the item 4 and 5 in col "b" as 2.1 & 2.2 and so on.....

  2. #2
    Tom Ogilvy
    Guest

    RE: Sequential number within excel

    Number them where?

    Using a Macro?

    --
    Regards,
    Tom Ogilvy


    "Dev" wrote:

    > Please see the data below
    >
    > a b c
    > 000000080672 EI0G18 1.00
    > EIVH38 1.00
    > EIVK38 1.00
    > 000000082585 EIRH69 1.00
    > EIRK69 1.00
    >
    > the first 3 items in column B belongs to the first item in column a.
    > Accordingly the next 2 items in col "b" belongs to the next item in col "A".
    > I want to number the first item in col "A" as 1 and the 3 items in col "B" as
    > 1.1, 1.2 1.3 and accordingly, the next item in col "a" as number 2 and
    > accordingly the item 4 and 5 in col "b" as 2.1 & 2.2 and so on.....


  3. #3
    Tom Ogilvy
    Guest

    RE: Sequential number within excel

    Number them where?

    Using a Macro?

    --
    Regards,
    Tom Ogilvy


    "Dev" wrote:

    > Please see the data below
    >
    > a b c
    > 000000080672 EI0G18 1.00
    > EIVH38 1.00
    > EIVK38 1.00
    > 000000082585 EIRH69 1.00
    > EIRK69 1.00
    >
    > the first 3 items in column B belongs to the first item in column a.
    > Accordingly the next 2 items in col "b" belongs to the next item in col "A".
    > I want to number the first item in col "A" as 1 and the 3 items in col "B" as
    > 1.1, 1.2 1.3 and accordingly, the next item in col "a" as number 2 and
    > accordingly the item 4 and 5 in col "b" as 2.1 & 2.2 and so on.....


  4. #4
    Dev
    Guest

    RE: Sequential number within excel

    Is there a way to number them in col "D".

    "Dev" wrote:

    > Please see the data below
    >
    > a b c
    > 000000080672 EI0G18 1.00
    > EIVH38 1.00
    > EIVK38 1.00
    > 000000082585 EIRH69 1.00
    > EIRK69 1.00
    >
    > the first 3 items in column B belongs to the first item in column a.
    > Accordingly the next 2 items in col "b" belongs to the next item in col "A".
    > I want to number the first item in col "A" as 1 and the 3 items in col "B" as
    > 1.1, 1.2 1.3 and accordingly, the next item in col "a" as number 2 and
    > accordingly the item 4 and 5 in col "b" as 2.1 & 2.2 and so on.....


  5. #5
    Tom Ogilvy
    Guest

    RE: Sequential number within excel

    Sub number_items()
    Dim imajor As Long, iminor As Long
    Dim rng As Range, cell As Range
    imajor = 0
    iminor = 0
    Set rng = Range(Cells(1, "B"), _
    Cells(Rows.Count, "B").End(xlUp))
    For Each cell In rng
    If Not IsEmpty(cell.Offset(0, -1)) Then
    imajor = imajor + 1
    iminor = 1
    End If
    cell.Offset(0, 2).Value = "'" & imajor _
    & "." & iminor
    iminor = iminor + 1
    Next
    End Sub

    Test this on a copy of your data. I assume the 1.0 are in column C. and
    column a has some blank cells in it (your labels in the post are a little
    off).

    --
    Regards,
    Tom Ogilvy


    "Tom Ogilvy" wrote:

    > Number them where?
    >
    > Using a Macro?
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Dev" wrote:
    >
    > > Please see the data below
    > >
    > > a b c
    > > 000000080672 EI0G18 1.00
    > > EIVH38 1.00
    > > EIVK38 1.00
    > > 000000082585 EIRH69 1.00
    > > EIRK69 1.00
    > >
    > > the first 3 items in column B belongs to the first item in column a.
    > > Accordingly the next 2 items in col "b" belongs to the next item in col "A".
    > > I want to number the first item in col "A" as 1 and the 3 items in col "B" as
    > > 1.1, 1.2 1.3 and accordingly, the next item in col "a" as number 2 and
    > > accordingly the item 4 and 5 in col "b" as 2.1 & 2.2 and so on.....


  6. #6
    MartinK
    Guest

    Re: Sequential number within excel

    Using Formulas it Would look something like this:
    Columns D
    =IF(ROW()=2;1;IF(A2<>"";D1+1;D1))
    Column E
    = IF(ROW()=2;1;E1+1)
    Column F
    = D2&"."&E2


+ 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