+ Reply to Thread
Results 1 to 11 of 11

Help with adding unique codes to numbers

  1. #1
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Help with adding unique codes to numbers

    Hi all.

    Could someone please help with a query.
    Is it possible to automatically add unique codes against specific numbers.
    As you can see from the document in column A, we have a lot of stock delivered and each pallet has a unique 7 digit number.
    Each item from that pallet has to have a label attached.
    Rather than adding the number, I have been giving each pallet a unique 2 digit letter in column B which makes it quicker to process the stock.
    Is it possible to generate the letters automatically so I don't have to keep filtering each pallet number and then giving it a two digit letter.
    As the first pallet I have given the letters PA, I just want to copy down and all subsequent numbers will be given the same reference.
    Then the next set of numbers will be given PB and so on.

    Hope I am making some sort of sense.

    Thanks for looking.

    Graham
    Attached Files Attached Files

  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,719

    Re: Help with adding unique codes to numbers

    This would be easier if you used a numeric suffix! What should happen when you get to Z?
    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-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: Help with adding unique codes to numbers

    That could be 3 or 4 weeks until we get to Z
    I would start back at AA again.

    Graham

  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,719

    Re: Help with adding unique codes to numbers

    Then you would end up with duplicate 'unique' codes. As I said, adding a numerical suffix.

    I'm not entirely sure what you are trying to do, though: adding PA to every instance of a 7-digit number does not make it any more unique than it was before.

  5. #5
    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,719

    Re: Help with adding unique codes to numbers

    Rather than adding the number, I have been giving each pallet a unique 2 digit letter in column B which makes it quicker to process the stock.
    How does adding a two-letter code instead of using the pallet number make it quicker? If we understood this, it might be easier to advise.

  6. #6
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: Help with adding unique codes to numbers

    We have a sale sheet where each item is given a lot number. When the sale is being typed in, it is much quicker to enter two letters than a 7 digit number.
    It cuts down on errors when typing in. When the sale is completed, I convert the codes back to numbers to send off to the Vendor so they can match the items to their manifest.
    Hope this makes sense.

    Graham

  7. #7
    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,719

    Re: Help with adding unique codes to numbers

    Why are you typing things in manually? Why not use a drop-down selection and lookups to complete your sale sheet. I'm really not clear why you need this, sorry. I think the wider picture might help.

  8. #8
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: Help with adding unique codes to numbers

    The sale sheet has multiple columns, each with a formula referencing something else within the workbook and it would take longer to click a dropdown and select the code than it would just to enter the letters.

    Graham

  9. #9
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Help with adding unique codes to numbers

    Here is a possibilty:
    After putting the number 80 in F2 the rest of the column is populated using: =IF(I2="Z",IF(CHAR(F2)="Z",65,F2+1),F2)
    Column G is populated using: =CHAR(F2)
    After putting the number 65 in H2 the rest of the column is populated using: =IF(A3=A2,H2,IF(CHAR(H2)="Z",65,H2+1))
    Column I is populated using: =CHAR(H2)
    Column B is populated using: =G2&I2
    Note: The formulas are dragged down to row 750 to show that they will produce AA (row 360) and eventually work back to PA. They should continue the progression through the last row of the spreadsheet.
    Note: Columns F:I may be hidden for aesthetic purposes.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  10. #10
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Help with adding unique codes to numbers

    Try this in B2:

    =LEFT(ADDRESS(1,27+MOD(389+SUMPRODUCT(1/COUNTIF($A$2:A2,$A$2:A2)),676),4),2)

  11. #11
    Registered User
    Join Date
    08-04-2015
    Location
    Stoke on Trent, England
    MS-Off Ver
    2010
    Posts
    58

    Re: Help with adding unique codes to numbers

    Thanks Phuocam.
    This is what I wanted.

    Graham

+ 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] Need to create unique pin codes
    By Tsheik in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 09-21-2021, 12:31 AM
  2. Replies: 1
    Last Post: 07-28-2016, 07:48 AM
  3. [SOLVED] Convert Y Codes from one column to another based on Unique Codes
    By ashishmehra2010 in forum Excel General
    Replies: 2
    Last Post: 10-06-2015, 09:49 PM
  4. count alphanumeric codes only counting odd numbers not even numbers?
    By JACKBKNIMBLE in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 07-25-2013, 02:43 PM
  5. [SOLVED] create list of unique staff numbers with unique work codes
    By shaz0503 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 01-01-2013, 08:57 PM
  6. Unique codes
    By Faith79 in forum Excel General
    Replies: 12
    Last Post: 10-23-2009, 01:48 PM
  7. [SOLVED] Counting Unique Codes
    By pgiessler in forum Excel General
    Replies: 1
    Last Post: 08-16-2006, 12:00 PM

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