+ Reply to Thread
Results 1 to 4 of 4

Searching Column Multiple Times & Adding +1 To Text

  1. #1
    Registered User
    Join Date
    08-21-2015
    Location
    DC
    MS-Off Ver
    2011
    Posts
    11

    Searching Column Multiple Times & Adding +1 To Text

    Hello!

    I'm in need of some help. I'm trying to create unique ID for a list of contacts and it involves searching the same column multiple times. Here's the outline.

    In column B:
    It has a list of companies. It could list multiple companies or individuals companies. Like this:

    ABC
    ABC
    ABC
    AMCE
    JET
    JET
    APPLE

    In column C:
    I would like to provide the output that basically creates a unique ID. I want to to search the existing list (Column B) and add a +1 every time the same company is found. For example this is the output I would like for column C:

    ABC-0001
    ABC-0002
    ABC-0003
    ACME-0001
    JET-0001
    JET-0002
    APPLE-0001

    As you can see for ABC, the first column it's the first ABC in the list so it adds a 1. Then it finds a second ABC so it adds another 1 and so on. If the company is only shown once it would just have 1.

    Thank you so much for your help
    Attached Files Attached Files
    Last edited by bathtubs; 08-04-2017 at 11:56 PM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Searching Column Multiple Times & Adding +1 To Text

    Try this:

    =B1&"-"&TEXT(COUNTIF(B$1:B1,B1),"0000")
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  3. #3
    Registered User
    Join Date
    08-21-2015
    Location
    DC
    MS-Off Ver
    2011
    Posts
    11

    Re: Searching Column Multiple Times & Adding +1 To Text

    Amazing - I think that does it! I just changed the cell number like this:
    =B2&"-"&TEXT(COUNTIF(B$2:B2,B2),"0000")

    and it was good to go. Really appreciate it!

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,869

    Re: Searching Column Multiple Times & Adding +1 To Text

    You're welcome!

    In future, please do not open multiple threads on the same issue, which is against the forum rules: just wait patiently for help. 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: 1
    Last Post: 08-05-2017, 12:06 AM
  2. [SOLVED] Adding multiple times in the same column.
    By squirrel32 in forum Excel General
    Replies: 6
    Last Post: 06-07-2016, 07:21 AM
  3. Replies: 6
    Last Post: 08-19-2015, 07:46 PM
  4. [SOLVED] Searching for text and adding cells
    By MATT.B in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 11-18-2014, 09:32 AM
  5. Searching number in text field and adding value to it
    By virupaksh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-07-2014, 10:40 AM
  6. [SOLVED] Find first and last instance of text in column range multiple times
    By ShannonHowell in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-24-2012, 11:52 AM
  7. Searching for text and adding a number value?
    By gsmonk in forum Excel General
    Replies: 2
    Last Post: 11-25-2007, 01:51 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