+ Reply to Thread
Results 1 to 3 of 3

Deleting duplicate cells with a catch (do I need to use an IF function)

  1. #1
    Registered User
    Join Date
    07-11-2012
    Location
    montana
    MS-Off Ver
    Excel 2010
    Posts
    3

    Deleting duplicate cells with a catch (do I need to use an IF function)

    Hi guys and gals,

    I have a 15,000+ spreadsheet that contains lots of information. One of the things I am tasked to do is delete the duplicate account numbers and the coresponding sales person.

    Here is an example:

    [Acct Number] [Sales persons first name] [Sales Persons last name]
    [012545566-4556] [Alfred] [Hitchcock]

    However, sometimes there are duplicates. Like this:

    Acct Number Sales persons first name Sales Persons last name
    012545566-4556 Alfred Hitchcock
    012545566-4556 Alfred Hitchcock


    Getting rid of the duplicates is not very difficult. But here is the challenge. Sometimes the duplicates are owned by different sales people

    Acct Number (G) Sales persons first name (H) Sales Persons last name (I)
    012545566-4556 Alfred Hitchcock
    012545566-4556 John Barlon

    Is there a way I can ignore the ones that have the same acct number but different sales people? =IF(Same sales person=>delete),(Different Sales person, dont delete)

    I wish it were that easy...

  2. #2
    Registered User
    Join Date
    07-11-2012
    Location
    Sweden
    MS-Off Ver
    Excel 2003
    Posts
    24

    Re: Deleting duplicate cells with a catch (do I need to use an IF function)

    Yes, you can use the And command. Example:

    If acct_nbr_1 = acct_nbr_2 And sls_person_1 = sls_person_2 Then
    delete acct_nbr_2
    delete sls_person_2
    End If

    Obviously this exact code will not work, first you have to define all the variables from cell values while looping through the data. Delete is also not a valid command, instead you will have to set the duplicate cell values to Empty. But hopefully the principle is clear.

    In this I kind of assumed you are using VBA to do this, am I correct in this assumption?

  3. #3
    Registered User
    Join Date
    07-11-2012
    Location
    montana
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Deleting duplicate cells with a catch (do I need to use an IF function)

    Hi Solaris,

    Thanks for your input, I am not familiar with VBA, I do not really know where to get started learning that even though I see it referenced all over the web.
    Your idea seemed great, but it will not work without VBA>

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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