+ Reply to Thread
Results 1 to 2 of 2

Code to generate new ID based on criteria

  1. #1
    Registered User
    Join Date
    07-01-2021
    Location
    Wolverhampton, England
    MS-Off Ver
    MS Office 2019
    Posts
    9

    Code to generate new ID based on criteria

    Hi, I have a spreadsheet (see attached), whereby in column C, I am trying to generate a new ID based on column B, i.e. if the row belongs in Core, then C0001, Structures then S0001, Mainline then M0001, Tunnel then T0001, Site Wide then SW0001. And it increases in incremental fashion, i.e. S0001, S0002, S0003...

    However, if in column A the old ID is duplicated, then the new ID will also be repeated (i.e. if 1002 Core appears twice in column A then C0002 will be generated twice in column C in the corresponding rows).

    Could anyone help please?
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    05-23-2013
    Location
    Shanghai, China
    MS-Off Ver
    Excel 2016
    Posts
    22

    Re: Code to generate new ID based on criteria

    try:
    Please Login or Register  to view this content.

+ 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. [SOLVED] Formula to Generate a cell's value based on certain criteria
    By stacymyers11 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 05-01-2020, 04:52 PM
  2. [SOLVED] Generate unique ID based on criteria from different columns
    By cherias in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-28-2019, 11:34 PM
  3. Generate a list based of certain criteria from multiple sheets
    By yarmin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-31-2018, 03:36 AM
  4. [SOLVED] Generate a list based on meeting certain criteria.
    By Losguapos1 in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 11-01-2015, 01:32 PM
  5. Generate a list based on meeting a criteria
    By nekomi15 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-02-2015, 02:31 PM
  6. Generate an Instruction Sheet Based on Criteria
    By thenoxus1 in forum Excel General
    Replies: 1
    Last Post: 01-16-2015, 04:12 PM
  7. Generate random # of days based on other criteria
    By Georgia Golfer in forum Excel General
    Replies: 3
    Last Post: 09-17-2010, 02:00 PM

Tags for this Thread

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