+ Reply to Thread
Results 1 to 10 of 10

Creating a reference from data in two cells and individually numbering

  1. #1
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20

    Creating a reference from data in two cells and individually numbering

    Attached is a spreadsheet

    To create the required reference, I need to add the whole of the text from column A to the last three characters of the text from column B.

    Therefore, data from cells A2 and B2 become ABP2122DEF.

    However, there are instances were the last three characters of the references to be generated are the same and so an additional numerical character starting from 1 should be added to the end of the reference, therefore reference from cells A2 and B2 becomes ABP2122DEF1.

    The numerical order should be generated based on the alphabetical order of the third character of the data in column A.

    e.g.
    A2 = ABP2122 - last character of reference becomes 1 - complete reference is ABP2122DEF1
    A3 = ABQ2122 - last character of reference becomes 2 - complete reference is ABQ2122DEF2
    A4 = ABR2122 - last character of reference becomes 3 - complete reference is ABR2122DEF3

    The expected reference numbers are shown in column E.

    Not sure if this generation of reference numbers can be achieved in the required format. Thanks for viewing.
    Attached Files Attached Files

  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: Creating a reference from data in two cells and individually numbering

    try this... =A2&RIGHT(B2,3)&COUNTIF($B$2:B2,B2) dragged down.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20

    Re: Creating a reference from data in two cells and individually numbering

    Thank you for the quick response.

    The formula works perfectly

  4. #4
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20

    Re: Creating a reference from data in two cells and individually numbering

    If there is no data in the field, how can I stop the calculation returning zero (0), but leaving the field as blank?

  5. #5
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20

    Re: Creating a reference from data in two cells and individually numbering

    Is there anyway that the last duplicate in column B can be highlighted in RED (for example) to indicate the last duplicate in the range? Columns A and B on the row should be highlighted to indicate the last reference

  6. #6
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20

    Re: Creating a reference from data in two cells and individually numbering

    Attached is a file where column B creates a reference from columns C & D.

    Firstly, when there is no data in columns C & D, the calculation returns '0'. Can this sum be modified so that blank is returned instead of '0'?

    Secondly, the references calculated in column B end numerically. Can the adjacent cells in columns C & D be highlighted at the end of each numerical sequence as demonstrated in the spreadsheet?
    Attached Files Attached Files

  7. #7
    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: Creating a reference from data in two cells and individually numbering

    try this instead... =IF(OR(C2="",D2=""),"",C2&RIGHT(D2,3)&COUNTIF($D$2:D2,D2))
    dragged down.

  8. #8
    Registered User
    Join Date
    05-24-2022
    Location
    Mansfield, England
    MS-Off Ver
    Office 2021
    Posts
    20
    Quote Originally Posted by Sam Capricci View Post
    try this instead... =IF(OR(C2="",D2=""),"",C2&RIGHT(D2,3)&COUNTIF($D$2:D2,D2))
    dragged down.
    Thanks Sam 😀
    Is there anyway where the last numerical sequence in column B can highlight the adjacent data in cells of columns C & D?

  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: Creating a reference from data in two cells and individually numbering

    Are you talking about conditional formatting?

    Right now I’ve shut down my computer and I’m on my iPad, so if nobody stops by to answer your question, I’ll take a look at it tomorrow morning my time.

  10. #10
    Forum Expert
    Join Date
    04-14-2009
    Location
    Taiwan
    MS-Off Ver
    Excel 2016,2019,O365
    Posts
    2,005

    Re: Creating a reference from data in two cells and individually numbering

    Conditional Format formula

    =COUNTIF($D2:$D$1000,$D2)=1

    applied to =$C$2:$D$1000


    if your data is continuous, you can use
    =$D2<>$D3
    Attached Files Attached Files
    Last edited by windknife; 06-09-2023 at 12:02 AM.

+ 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. How to use 2 cells for reference when creating folders
    By murray83 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-25-2018, 03:23 PM
  2. Multi level reference id - auto numbering - similar to legal numbering
    By smsko in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 12-11-2017, 06:05 AM
  3. [SOLVED] For each cell... look at a range of cells not individually
    By terratushi in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-30-2017, 12:31 PM
  4. Numbering sheets individually
    By Xander Crews in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 2
    Last Post: 03-24-2016, 04:43 PM
  5. Copying and pasting a table of data with individually color filled cells
    By Paragoomba in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-18-2013, 11:49 AM
  6. Create new row in a list creating new sheet with reference from cells
    By Karolis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-29-2010, 03:34 AM
  7. Unable to paste multiple cells, individually
    By Fos605 in forum Excel General
    Replies: 1
    Last Post: 04-19-2010, 11:19 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