+ Reply to Thread
Results 1 to 5 of 5

Generate a unique reference number?

  1. #1
    Registered User
    Join Date
    01-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Generate a unique reference number?

    Hi,

    I'm wanting some sort of formula to generate a reference number that relates to numbers i put in a cell. i want the end result to look something like this:

    Reference number
    362 3620001
    456 4560001
    362 3620002
    487 4870001
    456 4540002

    As you can see id like it to generate a reference number to the number that i input, and also when i input that number twice or three times it picks that up on the reference number also.

    Is there a possible formula for this? Any help would be brilliant!

  2. #2
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Generate a unique reference number?

    welcome to the forum, leondixon. i assume your last one should be 4560002? if that's the case & data starts in A2, try:
    =A2&TEXT(COUNTIF(A$2:A2,A2),"0000")

    that's a text by the way. if you need it recognized as as number, add 2 negatives in front to convert it
    =--(A2&TEXT(COUNTIF(A$2:A2,A2),"0000"))

    Thanks, if you have clicked on the * and added our rep.

    If you're satisfied with the answer, click Thread Tools above your first post, select "Mark your thread as Solved".

    "Contentment is not the fulfillment of what you want, but the realization of what you already have."


    Tips & Tutorials I Compiled | How to Get Quick & Good Answers

  3. #3
    Registered User
    Join Date
    01-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Generate a unique reference number?

    Hi,

    Yes that works great, thank you!

    Just another question, it may be quite simple but at this time in moment my mind has gone blank! How do i apply that formula to a whole cell, so i dont have to keep dragging the formula down to carry it on?

  4. #4
    Registered User
    Join Date
    01-09-2014
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Generate a unique reference number?

    Hi,

    Yes that works great, thank you!

    Just another question, it may be quite simple but at this time in moment my mind has gone blank! How do i apply that formula to a whole cell, so i dont have to keep dragging the formula down to carry it on?

  5. #5
    Forum Guru benishiryo's Avatar
    Join Date
    03-25-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2013
    Posts
    5,147

    Re: Generate a unique reference number?

    you're very welcome.

    you mean the whole column? that's not advisable. an xlsx file means you would have 1 million rows of formulas. if your formula is in B2 & you want to copy the formula until where your data stops,
    1. click on B2
    2. hover the cursor until it is at the bottom right of the selected cell. you should see a black cross. do a left mouse double-click

    if you want to prepare some additional rows of formulas but don't want "0000" to show up when it's a blank, try:
    =IF(A2="","",A2&TEXT(COUNTIF(A$2:A2,A2),"0000"))

    please mark the thread as Solved if opening question is answered. 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. [SOLVED] Code to generate a unique reference
    By matrixpom in forum Excel General
    Replies: 1
    Last Post: 02-24-2013, 08:16 PM
  2. Generate unique number
    By adeleex in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2011, 08:46 AM
  3. Replies: 3
    Last Post: 10-07-2011, 08:55 AM
  4. Generate a unique number of list
    By Terence Chan in forum Excel General
    Replies: 3
    Last Post: 09-14-2005, 02:48 AM
  5. Generate a unique form number
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-18-2005, 09:05 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