+ Reply to Thread
Results 1 to 14 of 14

Deleting Rows of Data that does not match certain column's description

  1. #1
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Exclamation Deleting Rows of Data that does not match certain column's description

    Hello everyone,
    I am stuck with an issue where:

    Ex:
    Column A = account number
    Column B = Pet Owner Type

    Column A / Column B
    232 NA
    232 NA
    232 CAT
    232 NA
    414 NA
    414 NA
    414 NA
    414 NA
    999 NA
    999 NA
    999 NA
    999 NA

    I want to delete all the accounts that does not own a CAT, so for instance, I would only have the following accounts remaining after filtering out.

    Account # Pet Owner
    232 NA
    232 NA
    232 CAT
    232 NA


    Helps is greatly appreciated, I've been stuck on this for a while. Thanks in advance!!

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Deleting Rows of Data that does not match certain column's description

    232 CAT owns a CAT, so why is/not deleted?
    You have only one CAT on your data. Do you want to delete if a cell that does not have CAT, or has CAT?

  3. #3
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Deleting Rows of Data that does not match certain column's description

    With an helpcolumn.

    Filter on column D on #N/A and delete that rows.
    Attached Files Attached Files
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  4. #4
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Deleting Rows of Data that does not match certain column's description

    Hi,
    I want to keep the account that has CAT, so, if account 232 had at least one CAT amongst the 4 x 232 accounts, all 232 accounts would be kept, whereas accounts like 414 and 999 which has no CAT at all, should all be deleted.

  5. #5
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Deleting Rows of Data that does not match certain column's description

    Unfortunately, I have a lot of columns and cannot afford to create a helpcolumn, is it possible to create an array that stores that data for each account and delete if the threshold is not satisfied?

  6. #6
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Delete the rows of a specific account if a certain column does not satisfy

    Hello everyone,

    I would like to delete all other accounts that does not have certain characteristics.
    For instance

    Account # Pet Owned
    1 N/A
    1 N/A
    1 N/A
    1 N/A
    2 N/A
    2 CAT
    2 N/A
    2 N/A
    3 N/A
    3 N/A
    3 N/A
    3 N/A
    4 N/A
    4 N/A
    4 CAT
    4 N/A

    So, in this case, all other accounts (1 and 4) would be deleted, and since one of the account 2 has CAT owned, all of the account# 2 should remain like so:

    Account # Pet Owned
    2 N/A
    2 CAT
    2 N/A
    2 N/A
    4 N/A
    4 N/A
    4 CAT
    4 N/A

    I believe I need to use an array, if not I would greatly appreciate any help in going about this issue.
    Last edited by exlgh91; 05-13-2013 at 01:59 PM.

  7. #7
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Delete the rows of a specific account if a certain column does not satisfy

    Try This.

    Let me know if this Is ok??

    Thank You,

    Deep
    Attached Files Attached Files
    Cheers!
    Deep Dave

  8. #8
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Delete the rows of a specific account if a certain column does not satisfy

    Sorry but could you walk me through the code? I want to know what's being done here to apply to my actual file, I'd greatly appreciate it.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Delete the rows of a specific account if a certain column does not satisfy

    This is an duplicated post!

    Please read the forumrules.

    http://www.excelforum.com/excel-prog...scription.html

  10. #10
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Delete the rows of a specific account if a certain column does not satisfy

    @exlgh91:

    When you joined the forum recently you agreed to abide by the Forum Rules, but in haste I fear you might not have actually read them. Please stop and take a moment to read them now. We all follow these rules for the benefit of all, as must you. Thanks.

    (link above in the menu bar)
    ===================================

    Your duplicate post does not comply with Rule 5 of our forum rules. Your two threads have been merged.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  11. #11
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Deleting Rows of Data that does not match certain column's description

    Sorry everyone!
    I was rushed near the deadline sorry!!

  12. #12
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Deleting Rows of Data that does not match certain column's description

    @exlgh91

    Here I am going through each cell in the used range in B Column. Where ever a Cell that is not N/A is found, the Value next to it in Column A is being stored in a Variable "i".

    Then I apply a Autofilter and Filter only "I". I then copy the visible cells and Paste it to a different location.

    Hope this helps..

    Cheers!

    Deep

  13. #13
    Registered User
    Join Date
    05-10-2013
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2003
    Posts
    26

    Re: Deleting Rows of Data that does not match certain column's description

    Test.xlsHello everyone, it is still unsolved at this point.

    In this file, I am trying to:

    1. For the accounts with <10 tradevolume (column F) filtered, delete groups of tradeidentifier (column J) row without a Pro account (column G)
    Thus, the result would be deleting everything else listed in the filter except the 4 rows with tradeidentifier (column J) 305948.

    2. Filter back out, and add whats left over to the rest of the group with >10 tradevolume (column K)

    Help is greatly appreciated, I will vouch someone who solves this till the end of time.

  14. #14
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Deleting Rows of Data that does not match certain column's description

    If you're in a hurry, why don't you use the already offered solutions.

+ 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