+ Reply to Thread
Results 1 to 17 of 17

Generate 6 digit numbers based on cell value

  1. #1
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Generate 6 digit numbers based on cell value

    Hello,
    Is there a formula that would generate a six or more digit number based on a cell value that contains text and numbers?
    I have been doing lots of formula tests and have not been able to get favorable results.

    Example:
    Cell A1 contains the following value "100' Talon command Cable 7 Pin Lemo"
    Cell A2 contains the following value "12" 2Pin Lemo/Xlr Sraight Thrugh Camera Power Pigtail"

    Cell B1 would get a result of six digit number based on A1 values.
    Cell B2 would get a result of six digit number based on A2 values.

    And if I copy value from A1 to any cells in column A, the same number should follow and not change.
    The generated number should always be associated to the value

    Thank you so much for your time and help
    Cheers
    Nino

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Generate 6 digit numbers based on cell value

    maybe use a table of the text values and the numbers you want, then do a vlookup or index match against that table?
    For a better answer maybe upload a sample workbook WITH expected results and we can give you a better answer.
    the instructions are at the top of the post in the yellow banner for how to upload a workbook.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    Hello Sambo
    I have attached a sample file for reviewing
    Thank you
    Attached Files Attached Files

  4. #4
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Generate 6 digit numbers based on cell value

    so, you don't already have a six digit number for these products? You want excel to generate one for a product then every time you have that product you want excel to use it again, is that correct?

  5. #5
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    Yes Sambo. Correct

  6. #6
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Generate 6 digit numbers based on cell value

    you can use =RANDBETWEEN(100000,999999) to generate random six digit numbers but they will change every time you hit enter or save on the workbook. If your list is not too big it is likely you will not get any repeated numbers in the list.
    so I'm uploading your workbook with my "solution" as it is. But to get something cleaner I think you might need VBA.
    So...
    step 1, make a distinct list of your description of items that are in your data entry sheet, (copy list into another workbook and use remove duplicates)
    step 2, remove duplicates
    step 3, use randbetween formula
    step 4, copy random numbers and paste special >> values so they do not change next time you use them.
    step 5, use vlookup in your data entry sheet to bring over the six digit numbers.
    (attached example)
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-12-2012
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2013
    Posts
    38

    Re: Generate 6 digit numbers based on cell value

    I'd use a lookup for the rows above, to determine if the description has occurred before, if it has use vlookup to return the product number, if not then add 1 to the max of the prod id's above.
    formula in j39 of your file attached: =IFERROR(VLOOKUP(D40,$D$2:$J39,7,FALSE),MAX($J$3:J39)+1)
    if you manually set a number it will use that instead, but being a vlookupup it will take the first example it finds. Also being based on the description is needs to match 100% or it will consider it a new description.
    Attached Files Attached Files
    Ron

    Nothing is guaranteed

  8. #8
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    I have tried that method,
    But sometimes I Need to change the description of the item or add more items
    and that's done on a very short notice. literately speaking, seconds. (meaning while I am on the phone with production)
    To take all the above steps during Prep it would a nightmare for me
    that's why I was hoping for an automated way

  9. #9
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: Generate 6 digit numbers based on cell value

    Post #8, I'm not sure if you are referring to my proposed solution or Ron's.
    But if formulas will not work then you might want to private message a moderator to request the post be moved to the VBA forum as I think that might be your only solution.

  10. #10
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    Sambo, thanks for trying
    how do I PM a moderator to move my post to VBA?

  11. #11
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Generate 6 digit numbers based on cell value

    Hello,
    Is there a formula that would generate a six or more digit number based on a cell value that contains text and numbers?
    I have been doing lots of formula tests and have not been able to get favorable results.

    Example:
    Cell A1 contains the following value "100' Talon command Cable 7 Pin Lemo"
    Cell A2 contains the following value "12" 2Pin Lemo/Xlr Sraight Thrugh Camera Power Pigtail"

    Cell B1 would get a result of six digit number based on A1 values.
    Cell B2 would get a result of six digit number based on A2 values.

    And if I copy value from A1 to any cells in column A, the same number should follow and not change.
    The generated number should always be associated to the value

    See attached Sample

    Thank you so much for your time and help
    Cheers
    Nino
    Attached Files Attached Files

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Generate 6 digit numbers based on cell value

    why would you give an example in your thread of A1 and B1 - and sample data, then upload a sample file that bares absolutely zero reference to those cells?
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  13. #13
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Generate 6 digit numbers based on cell value

    Also, perhaps provide a crystal ball that shows how you conjured up those numbers in col J...if in fact that IS what you were trying to create?

    If they are indeed arbitrary numbers, what on earth DO you want the numbers to look like?
    remember, we are neither mind readers now magicians here lol

  14. #14
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Generate 6 digit numbers based on cell value

    I have merged this thread with your other (not permitted) duplicate thread here....
    https://www.excelforum.com/excel-pro...ell-value.html

  15. #15
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    Hello FDibbins,
    You are right about the sample file bearing zero references. Sorry.
    This is what my original post should have been, and the uploaded sample would match.

    Example:
    Cell D1 contains the following value "10' 4 Pin Xlr 16 Gauge Talon Power Cable"
    Cell D2 contains the following value "10' 4Pin Xlr 14 Gauge Grey Talon Power Cable"

    Cell J1 would get a result of six digit number based on D1 values.
    Cell J2 would get a result of six digit number based on D2 values.

    And if I copy value from D1 to any cells in column D, the same number should follow and not change.
    The generated number should always be associated to the value
    As per the Numbers in Column J, they have no reference. I typed them to project a desired solution.

    See attached Sample

    Late at night and iI am still trying.

  16. #16
    Forum Expert Crooza's Avatar
    Join Date
    10-19-2013
    Location
    Hunter Valley, Australia
    MS-Off Ver
    Excel 2003 /7/10
    Posts
    2,082

    Re: Generate 6 digit numbers based on cell value

    I just entered j3 = 100001 then use this in J4 and drag down (provided you don't want random numbers

    Please Login or Register  to view this content.
    Happy with my advice? Click on the * reputation button below

  17. #17
    Forum Contributor
    Join Date
    01-25-2014
    Location
    Italy - Currently In USA
    MS-Off Ver
    Excel 2019
    Posts
    206

    Re: Generate 6 digit numbers based on cell value

    Hello Gents,
    I wanted to Thank everyone for trying to Resolve my request.
    I wanted to share with you my request has been Solved and I am very happy.
    Now I can have Unique numbers based on Cell Value and they will stay the same regardless of where I place The item.
    I have attached the Sample sheet with all the Formula and code. In the event someone out there may want a similar function

    Thank you All
    Cheers
    Nino
    Attached Files Attached Files

+ 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: 20
    Last Post: 09-27-2019, 10:11 AM
  2. Generate non-repeating random Double-Digit numbers
    By jomili in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-17-2019, 09:32 AM
  3. [SOLVED] Code to generate 2000 unique 8 digit numbers
    By Excelski in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 07-20-2017, 07:52 AM
  4. [SOLVED] VBA to generate random 5-digit serial numbers using
    By emymeeky in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-31-2014, 03:34 PM
  5. [SOLVED] macro to extract 9 digit numbers as well as alpha numberic 9 digit numbers from txt file
    By Raju Radhakrishnan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-13-2012, 10:15 AM
  6. Generate consecutive numbers based on the value of a cell
    By _Kathy in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-11-2010, 04:10 AM
  7. How do I generate a list of 5-digit numbers in Excel?
    By Cowboy in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-29-2005, 11:05 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