+ Reply to Thread
Results 1 to 3 of 3

Generate unique ID's with a common prefix

  1. #1
    Registered User
    Join Date
    09-25-2017
    Location
    Lonodn
    MS-Off Ver
    Office 365
    Posts
    2

    Generate unique ID's with a common prefix

    Hi All,

    I have a spreadsheet with multiple tabs. I want to create a unique ID which can be a simple number sequence but needs to have a prefix appended to it based on a project acronym. So, something like this:

    MDZ001 where MDZ is the prefix I can declare in a cell on the first sheet and 001 is the first number in sequence

    I need to make sure that the ID's are unique for all tabs, so I don't want to see MDZ001 on any other tab, i.e. the source for ID creation needs to be central to each spreadsheet.

    I'm going to go away and see if I can fix myself, but I thought I would preempt me being a dullard and ask you peeps first!

    Cheers

    Matt
    Last edited by matt_zedsen; 10-12-2017 at 05:02 AM. Reason: Additional info

  2. #2
    Registered User
    Join Date
    09-25-2017
    Location
    Lonodn
    MS-Off Ver
    Office 365
    Posts
    2

    Re: Generate unique ID's with a common prefix

    OK, this is stumping you guys? I have come up with a workaround in case anyone else is needing this as well:

    To create a prefix like this which is unique: MDX1001

    Create a prefix for all IDs on first tab: MDX - this changes for each project

    Create a second prefix that is unique for each tab in cell A1 and colour it white. I only need to put this info in one when I create the template 100 for tab 1, 200 for tab2 etc. Saves time each time I use this template

    Create a number list for each row to draw from in my ID formula and then colour it white to hide

    Use this formula in the ID generation cell:

    =IF((OR(C10="",D10="",F10="")),"",TAB1!$G$5&$A$1&H10) Checks if any key cells are empty, if so, no output. Looks up the prefix 1 on tab 1, looks up prefix 2 on current tab, looks up row number and appends all three together to create the unique ID

    I could have used the ROW() function to report the row and not have to create a column of white numbers using (ROW()-9) to get the sequence to start from 1 each time, but it would do a drag copy which was strange.

  3. #3
    Forum Expert Olly's Avatar
    Join Date
    09-10-2013
    Location
    Darlington, UK
    MS-Off Ver
    Excel 2016, 2019, 365
    Posts
    6,284

    Re: Generate unique ID's with a common prefix

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source

    If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE

    Walking the tightrope between genius and eejit...

+ 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: 7
    Last Post: 08-15-2016, 01:41 AM
  2. Add common prefix to all cells in Excel
    By Nirmall in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-09-2016, 12:09 AM
  3. Merge worksheets with unique key in common
    By porpitax2 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-22-2015, 11:00 AM
  4. [SOLVED] Import multiple worksheets with common prefix
    By chris5001 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-03-2014, 05:35 PM
  5. [SOLVED] Need help in adding prefix to each unique entries in cell
    By shaikfazil in forum Excel General
    Replies: 5
    Last Post: 06-12-2013, 08:02 AM
  6. [SOLVED] Need help in adding prefix to each unique entries in cell
    By shaikfazil in forum Excel General
    Replies: 1
    Last Post: 06-12-2013, 05:48 AM
  7. generate a list that both columns have in common
    By wchillman in forum Excel General
    Replies: 2
    Last Post: 10-25-2008, 02:32 AM

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