+ Reply to Thread
Results 1 to 9 of 9

Numbering a column if a string is recognised in the adjacent column

  1. #1
    Registered User
    Join Date
    08-29-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Wink Numbering a column if a string is recognised in the adjacent column

    Hi
    What I want to do is label the first column a value if the specific branch is found in the adjacent column. When the next branch is found it starts putting the next value in the column.

    1 Branch1
    1 Name Account
    1 Name Account
    1 Name Account
    1 Name Account
    1 Name Account
    1 Name Account

    2 Branch2
    2 Name Account
    2 Name Account
    2 Name Account
    2 Name Account

    3 Branch3
    3 Name Account
    3 Name Account
    3 Name Account
    3 Name Account

    Help Please

  2. #2
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Numbering a column if a string is recognised in the adjacent column

    Hi,

    Suppose you want to number column A (starting at A2), and the "Branchx" is located in column B. Then try this formula in cell A2 and drag it down as far as is necessary:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this helps

  3. #3
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Numbering a column if a string is recognised in the adjacent column

    Actually, try this formula instead. This will accommodate for blank rows in between branches:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    08-29-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Numbering a column if a string is recognised in the adjacent column

    That almost works. But then the value for Branch 1 starts repeating after one vale of Branch 2. It also give a circular error:/

  5. #5
    Registered User
    Join Date
    08-29-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Numbering a column if a string is recognised in the adjacent column

    1 Branch 1
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1
    2 Branch 2
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name

    BUT
    really im looking for this 1 Branch 1
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1 Name
    1
    2 Branch 2
    2 Name
    2 Name
    2 Name
    2 Name
    2 Name
    2 Name
    2 Name
    2 Name
    2 Name

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Numbering a column if a string is recognised in the adjacent column

    perhaps this way needs b1 to be blank
    Attached Files Attached Files
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    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

  7. #7
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Numbering a column if a string is recognised in the adjacent column

    That is correct Martin. B1 must be blank for my formula to work

  8. #8
    Registered User
    Join Date
    08-29-2013
    Location
    New York
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Numbering a column if a string is recognised in the adjacent column

    Thanks very much
    martin and ajryan

  9. #9
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Numbering a column if a string is recognised in the adjacent column

    No problems!

    Please don't forget to mark this thread as solved, and please click on the * next to my post to say thanks

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 12
    Last Post: 09-15-2012, 10:20 PM
  2. Replies: 5
    Last Post: 01-18-2012, 08:33 AM
  3. Replies: 1
    Last Post: 07-26-2011, 06:48 AM
  4. adding values as 1 string, based on adjacent column
    By TCountryman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-13-2010, 10:51 AM
  5. Replies: 6
    Last Post: 03-04-2006, 07:30 AM

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