+ Reply to Thread
Results 1 to 4 of 4

Merge two cells, no duplicates

  1. #1
    Registered User
    Join Date
    05-19-2022
    Location
    Derbyshire, UK
    MS-Off Ver
    365
    Posts
    2

    Merge two cells, no duplicates

    Hi, I'm a first-time poster and have an issue that is really baffling.
    Unfortunately, I am working on an xls which is data from a database that is being moved into a new database.

    The columns don't match between databases and the datasets also need converting. For background, I work for an asbestos consultancy.
    I'm using XLOOKUP to match the original data with the required new data.
    Where I am now having an issue is I have two rows, Asbestos Type 1 (AO) and Asbestos type 2(AP). These are being merged into a column with comma separation (AQ) which is then used to do a lookup in column (AR) .

    I can't have duplicates in the new data so I am using the following formula.

    The formula used is in the attachment in column C "Asbestos Raw" as it's getting seen as a link here

    The issue is when I have a blank second cell which is the case for a lot of the data I get a #NA as there is no data.
    Any clue how to correct the above formula or a better way to do this?

    Thanks in advance to anyone who can assist.
    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. 2405 (Windows 11 23H2 64-bit)
    Posts
    81,442

    Re: Merge two cells, no duplicates

    Welcome to the forum.

    Sorry, but with formulae like this we can't help:

    =XLOOKUP('C:\Users\Mark.Ogden\Desktop\Tersus Data Manager\TEAMS Import sheet - Blank.xlsm'!Table1[@[Asbestos Raw]],'C:\Users\Mark.Ogden\Desktop\Tersus Data Manager\[TEAMS Import sheet - Blank.xlsm]E-Risk Dropdowns'!$E$29:$E$67,'C:\Users\Mark.Ogden\Desktop\Tersus Data Manager\[TEAMS Import sheet - Blank.xlsm]E-Risk Dropdowns'!$F$29:$F$67,"",0,1)

    Please mock up in ONE workbook a sheet showing what you want and a sheet showing the layout of the source data.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, relevant cells highlighted and a few explanatory notes.
    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
    05-19-2022
    Location
    Derbyshire, UK
    MS-Off Ver
    365
    Posts
    2

    Re: Merge two cells, no duplicates

    Hi Ali, Thanks for your reply. I've changed the sheet and made a mockup of what I need. You can see where I started by using TEXTJOIN which keeps the duplicates.
    So the trouble column for me now is just column C.
    I had tried TEXTJOIN using MATCH to look for the duplicates which did work, but because sometimes column B is empty it returns the error #N/A

    Thank you
    Attached Files Attached Files

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

    Re: Merge two cells, no duplicates

    I cannot see a difference between the files in posts #1 and #3. Also, there is no source data in either file as Ali requested which makes it very hard to troubleshoot the formula.
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

+ 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. Merge rows containing duplicates
    By Coretex in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-26-2019, 09:23 PM
  2. Easy way to merge duplicates but add missing cells
    By NYCData in forum Excel General
    Replies: 2
    Last Post: 10-19-2017, 03:33 AM
  3. Replies: 11
    Last Post: 11-29-2016, 01:00 PM
  4. Replies: 2
    Last Post: 04-08-2014, 04:44 AM
  5. Merge Cells(maybe) then delete duplicates
    By J_Tackett in forum Excel General
    Replies: 4
    Last Post: 04-21-2010, 09:07 AM
  6. merge wordlist without duplicates
    By wali in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-30-2009, 03:25 AM
  7. How to merge and weedout duplicates
    By akondeti in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-19-2008, 12:48 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