+ Reply to Thread
Results 1 to 6 of 6

How to delete rows with a unique value in given column- ? formula and/or sort?

  1. #1
    Registered User
    Join Date
    03-22-2012
    Location
    M, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    45

    How to delete rows with a unique value in given column- ? formula and/or sort?

    I have three fields in my worksheet:

    1. Customer ID Nbr
    2. Product Ordered
    3. Order Date

    I would like to delete rows for all customers who have only one record (so only one Customer ID Nbr) in this worksheet. The end result would be to retain the Customer ID Nbr, the Product Ordered, and the Order Date ONLY for those customers who have placed more than one order.

    Is there a fomula and/or sort that would easily accomplish this?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: How to delete rows with a unique value in given column- ? formula and/or sort?

    You could use a countif to count the entries for each customer
    then select all the customers who have one purchase
    then delete them.

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: How to delete rows with a unique value in given column- ? formula and/or sort?

    Hi,

    So if a record appears only once in Col A then you want to delete it keeping only those records that appear more than once. Try this


    Please Login or Register  to view this content.
    Last edited by Blake 7; 12-05-2014 at 11:18 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  4. #4
    Registered User
    Join Date
    03-22-2012
    Location
    M, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: How to delete rows with a unique value in given column- ? formula and/or sort?

    Thanks for your response. Without seeing the data, can you tell me what "criteria" should be used within the Countif function in order to count the number of entries for each customer (field name: Customer ID Nbr).

  5. #5
    Registered User
    Join Date
    03-22-2012
    Location
    M, Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: How to delete rows with a unique value in given column- ? formula and/or sort?

    Thank you for your responses! I was having some problems with CountIf but found that I was able to use Conditional Formatting to color duplicate Customer ID Nbrs and then sort that field by cell color in order to separate out the records with unique Customer ID Nbr in one block and easily delete them.

  6. #6
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: How to delete rows with a unique value in given column- ? formula and/or sort?

    Did you try to use the macro I offered - its a lot simpler and quicker than using CF - sorting and deleting!

+ 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] Delete entire Rows if Column value is unique OR Duplicate is less than three
    By analystbank in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2014, 12:09 PM
  2. Replies: 7
    Last Post: 07-24-2010, 08:07 PM
  3. Delete rows if the unique ID appear once or twice only
    By kaffal in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2009, 03:07 PM
  4. Replies: 1
    Last Post: 06-20-2009, 03:43 PM
  5. Sort Column, Delete Rows, Delete Column, Move Molumn, more inside?
    By motown in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 05-13-2008, 09:44 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