+ Reply to Thread
Results 1 to 19 of 19

Find and delete rows using multiple values

  1. #1
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Find and delete rows using multiple values

    Hi,

    Can you help me with the function or formula to find multiple values and delete them all together. Because right now, I am using Find>Input Value>Find All. I am doing this process one value at a time. Is there a way to input multiple values as per my list?

    Or, is there a way that I have list on column A and my “To Find List” on column B, and use this to find and delete all rows with values in column A? Here is what I am planning to do if possible:

    Column A
    abc.com/conents100
    abc.com/contets200
    abc.com/contents300
    123.com/contentsaaa
    123.com/contentsbbb
    123.com/contentsccc

    Column B (find these values and delete all rows in column A)
    abc.com
    123.com

    Thanks in advance.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Find and delete rows using multiple values

    .
    If you don't have a LONG list of terms/words to search for ... this is one way :

    Please Login or Register  to view this content.
    Attached Files Attached Files

  3. #3
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find and delete rows using multiple values

    You cannot delete rows (or anything else, really) with formulas or functions. At best, you could use a formula to ID which rows to delete, filter rows on that result, then delete them all together
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  4. #4
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Quote Originally Posted by Logit View Post
    .
    If you don't have a LONG list of terms/words to search for ... this is one way :
    Thanks Logit. I have a long list (hundreds) of terms to search. This is the reason why I want the list to be in separate column and make a compare/search function. Is there any way to do that?
    Last edited by AliGW; 10-24-2018 at 05:21 AM. Reason: Quotation trimmed.

  5. #5
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Quote Originally Posted by FDibbins View Post
    You cannot delete rows (or anything else, really) with formulas or functions. ...
    Hi, is there a way to find/select rows in column A if it contains a term from column B?
    Last edited by AliGW; 10-24-2018 at 05:21 AM. Reason: Quotation trimmed.

  6. #6
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find and delete rows using multiple values

    Probably, yes, can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.

  7. #7
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Hi FDibbins. Attached here is the clean file. I'm a webmaster and presently cleaning my link profile. Column A are the links pointing to my site. Column B are good links that I wanted to remove from Column A. So, what will be left on Column A are links that are still not yet on my "Good Links" list.

    Please take note that not all terms on Column B are still present on Column A. My "Good Links" list have accumulated for years and some websites may be inactive now or have removed the links pointing to my website.

    Thanks.
    Attached Files Attached Files
    Last edited by AliGW; 10-24-2018 at 05:20 AM. Reason: Unnecessary quotation removed.

  8. #8
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Find and delete rows using multiple values

    Based on your file, try this...
    C2=MATCH("*"&B2&"*",$A:$A,0)
    D2=MATCH(ROW(),$C:$C,0)
    both copied down.

    Then filter on D, uncheck #N/A and you will be left with the rows to delete in col A. Note that if you delete the entire row, you will lose anything you have in col B in that same row.

    A better option would be to do the filter, then just delete the cell contents of what shows, then either SORT A or use the Remove Duplicates

  9. #9
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Thank you for that formula. I applied what was instructed. I don't know If I have done the right thing, but the results on Column A shows some of links (with terms dell.com, bullguard.com, etc...) which I wanted to hide/remove. What I wanted to do is hide/delete from column A if it has a match listed in column B. This way, what is left in Column A are links that I need to check.

    sample2.png
    Last edited by AliGW; 10-24-2018 at 05:19 AM. Reason: Unnecessary quotation removed.

  10. #10
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Find and delete rows using multiple values

    Building on, or stealing from (sorry about that), Ford's suggestion, apply the formula in column C down as far as row 309 so that it includes all the domains in the 'Remove These Domains' list and not the domains under the 'IN QUESTION ????' list. Now apply the formula in column D down to row 2552.
    Next, populate column E with the web sites whose domains are not in the 'Remove' list using:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  11. #11
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Hi JeteMc, first of all, let me thank you for the help. I am exploring the sheet with your formula, why is it that modifying any item on the sheet changes the value of Column E to #NAME? Is there any special formatting on this sheet?

    Also, I can still see the value dell.com on rows 1895 etc of Column E... It is not supposed to be there because it was listed in Column B.

    By the way, you can erase the "IN QUESTION" rows. I may or may not include it in this column.

    Hoping for your patience guys.
    Last edited by llessur; 10-24-2018 at 05:19 AM.

  12. #12
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,780

    Re: Find and delete rows using multiple values

    Llesseur - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  13. #13
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    AliGW, Sorry for that.

  14. #14
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Find and delete rows using multiple values

    Here is more of a brute force approach.
    1) The domains to be deleted are copied and pasted transpose into C1:KX1
    2) The range C2:KX2552 (which may be hidden) is populated using: =ISNUMBER(SEARCH(C$1,$A2))
    3) KY2:KY2552 is populated using: =COUNTIF(C2:KX2,TRUE)
    4) KZ2:KZ2552 is populated using: =INDEX(A$2:A$2552,AGGREGATE(15,6,(ROW($2:$2552)-1)/(KY$2:KY$2552=0),ROW(1:1)))
    The next column and cell are used for testing the presence of the domain in LM1 which is a drop down linked to C1:KX1 so that you can change the domain in that cell to check for the occurrence of other domains that should have been deleted.
    5) LM2:LM2552 is populated using: =ISNUMBER(SEARCH(LM$1,KZ2))
    6) LN2 is populated using: =COUNTIF(LM2:LM2552,TRUE)
    Unfortunately the size of the file is too large to upload (5+ Mb). If you have problems applying the above I'll reduce the number of linking pages and domains to be deleted until I get the file size reduced to less than 1000 Kb.
    Let us know if you have any questions.

  15. #15
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Find and delete rows using multiple values

    I was able to upload a .zip file
    Let us know if you have any questions.
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    JeteMc, I really appreciate your effort. However, I find it too hard to learn the last approach. Is there a way to upload working sheets that is editable. I mean, you can reduce data to a hundred but is it possible for me to add more values or re-use the sheet for my future tasks? I am performing this Inbound Link Cleanup thing almost every other month and I am tired of using "Find All" for each domain. I am also searching for software to make this job easier but to no avail. Thanks.

  17. #17
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: Find and delete rows using multiple values

    Maybe
    Please Login or Register  to view this content.

  18. #18
    Registered User
    Join Date
    10-20-2018
    Location
    Philippines
    MS-Off Ver
    MS Office 2013
    Posts
    9

    Re: Find and delete rows using multiple values

    Hi JeteMc. just downloaded the zip file. The formula works perfect.

    Thank you very much.

  19. #19
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: Find and delete rows using multiple values

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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 Rows except rows with specific values across multiple uniquely named Worksheets
    By moosetales in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-23-2016, 03:04 PM
  2. How to find value in column, then delete multiple rows from that row
    By hadamhiram in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-18-2014, 07:49 AM
  3. Delete multiple rows after find?
    By wattmhite in forum Excel General
    Replies: 4
    Last Post: 05-13-2014, 12:36 PM
  4. Multiple find (and delete) non-continuous rows
    By Mattski in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2012, 09:27 AM
  5. Macro Help - Find Max Value in Multiple Ranges Then Delete Non-Max Rows
    By MrEE2 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2011, 04:04 PM
  6. Find then Delete rows from multiple sheets?
    By gronnies in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-19-2010, 07:07 PM
  7. Find and Delete multiple rows
    By Crockett in forum Excel General
    Replies: 3
    Last Post: 04-03-2007, 05:38 PM

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