+ Reply to Thread
Results 1 to 7 of 7

Formula to remove duplicates and return a certain cell's text if duplicates found

  1. #1
    Registered User
    Join Date
    11-27-2018
    Location
    Bucharest, Romania
    MS-Off Ver
    2013
    Posts
    3

    Formula to remove duplicates and return a certain cell's text if duplicates found

    Hello, I need to create a formula that does the following:

    Using a single formula I need to detect all of the duplicates in a list, if the term has already appeared in the list the formula should display it on the same row (delete it from it's original location and move it to the same row). If the term has no already appeared then the formula should display N/A. The values in the column are text, if that makes a difference.

    I tried using countif but value if true can't be another cell's text.


    Thank you in advance for your help

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    Will you please attach a SMALL sample Excel workbook (10-20 rows of data is usually enough)? However, please give us an indication of the approximate number of rows of data you want the solution to work with (100, 1000, 100,000 or whatever). Please don't attach a picture of an Excel sheet (no-one will want to re-type all your stuff before starting).

    1. It does NOT have to be your real sheet - mock up a SAMPLE if you need to. But not 1000's of rows!!! It makes manual checking so tedious. Whatever you do... make sure that all confidential information is removed first!!

    2. Make sure that your sample data are truly REPRESENTATIVE of your real data. The use of unrepresentative data is very frustrating and can lead to long delays in reaching a solution.

    3. Make sure that your desired solution is also shown (mock up the results manually).

    4. Try to avoid using merged cells. They cause lots of problems!

    Unfortunately the attachment icon doesn't work at the moment. So, to attach an Excel file you have to do the following: Just before posting, scroll down to Go Advanced and then scroll down to Manage Attachments. Now follow the instructions at the top of that screen.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    Hi Formulae can't remove data, you'd need VBA to do that.

    However you can identofy duplicates by using the MATCH() function and once you've auto filtered the data using the column with the match function you can delete/copy/paste the rows as you wish and then remove the autofilter
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    11-27-2018
    Location
    Bucharest, Romania
    MS-Off Ver
    2013
    Posts
    3

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    If there's no way to integrate the removal of the rows that contain duplicates in the formula I'd be glad if we can solve the second part of the problem: if a duplicate is found the formula will return the contents of the duplicate cell in the desired cell.

    I attached a mock excel containing my problem and desired results as asked. I will need this formula to work on less than 100 rows.
    Attached Files Attached Files

  5. #5
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    In B2, copied down:

    =IF(COUNTIF(A:A,A2)>1,A2,"N/A")

    You may need ; instead of ,
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-27-2018
    Location
    Bucharest, Romania
    MS-Off Ver
    2013
    Posts
    3

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    Thanks, I tried something similar but I did not remember that I must not use "" for value return if I wanted a cell to be returned. Rusty excel skills. Much appreciated.

    Can be edited as solved.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Formula to remove duplicates and return a certain cell's text if duplicates found

    You're welcome.



    If that takes care of your original question, please select "Thread Tools" from the menu link above and mark this thread as SOLVED.

    It'd also be appreciated if you were to click the Add Reputation button at the foot of any of the posts of all members who helped you reach a solution.

+ 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] Remove duplicates but remove first value found not second
    By Carlx12 in forum Excel General
    Replies: 3
    Last Post: 07-11-2018, 05:39 AM
  2. How to search substring against row and if duplicates found, remove them?
    By joshman10888 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2016, 10:00 PM
  3. [SOLVED] Formula to return the last text and value within duplicates
    By Shellybelly in forum Excel Formulas & Functions
    Replies: 15
    Last Post: 06-30-2016, 04:39 AM
  4. remove duplicates based on name found in column b
    By antiKILLER in forum Excel General
    Replies: 2
    Last Post: 03-01-2016, 02:57 PM
  5. Replies: 1
    Last Post: 07-30-2014, 02:37 PM
  6. Remove cells if duplicates found
    By garnerseo in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-18-2013, 08:54 AM
  7. Replies: 2
    Last Post: 03-20-2011, 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