+ Reply to Thread
Results 1 to 14 of 14

Excel 2007 : removing rows after counting / subtotaling a data in a column

  1. #1
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    removing rows after counting / subtotaling a data in a column

    Is there an fast or easy way to remove rows where the count on a particular column or field is less than 3? For example, I have a customer ID that appears on multiple records. Where there are less than 3 records per customer ID, I want to delete those rows and the associated count. Can this be done automatiically? If so, how? Please help.

  2. #2
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    you could run a macro on the data, do you have a sample that i could use to develop the macro?
    If you liked my solution, please click on the Star -- to add to my reputation

    If your issue as been resolved, please clearly state so and mark the thread as [SOLVED] using the thread tools just above the first post.

  3. #3
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    Here is sample data. Any help would be appreciated.

    100384021 12/04/2010 02 - Lost ROGERS TAMPA FL
    100384021 Count 1
    100384033 06/24/2011 02 - Lost SMITH PLANTATION FL
    100384033 Count 1
    100384038 07/08/2010 02 - Lost WILLS BUNNELL FL
    100384038 01/03/2011 02 - Lost WILLS BUNNELL FL
    100384038 02/05/2011 02 - Lost WILLS BUNNELL FL
    100384038 Count 3

  4. #4
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    can you please attach as a workbook?

  5. #5
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    I'm sorry, but I can't figure out how to attach the sample spread sheet. Can you point me in the right direction? Very grateful for your assistance.

  6. #6
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    Ok, I figured it out. I have attached the sample file you requested. Thank you.
    Attached Files Attached Files

  7. #7
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    Try this macro out

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    Thank you for your help and taking the time. I appreciate it. The highlighted row shows a problem when I try to run the macro.

    Excel Marco Code.GIF

  9. #9
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    your book is probably in .xls format, try changing the 100000 to 65536

  10. #10
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    I have 264003 rows and the file is saved as xlsx. I also have 3 worksheets in the file. Could that be an issue? I am still getting the same error "Overflow"

  11. #11
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    i did not expect you to have greater than 100,000 rows, so i used that number, try using 1048576 this is the max rows in a .xlsx book.

  12. #12
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    Ok, I'll give it a try. Thank you.

  13. #13
    Registered User
    Join Date
    04-04-2012
    Location
    Wisconsin
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: removing rows after counting / subtotaling a data in a column

    Thank you for your help. It was great!

  14. #14
    Forum Expert DGagnon's Avatar
    Join Date
    02-23-2012
    Location
    Ontario, Canada
    MS-Off Ver
    Excel 2003, 2007
    Posts
    1,645

    Re: removing rows after counting / subtotaling a data in a column

    no problem, please come back to ExcelForum if you have any other questions in the future.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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