+ Reply to Thread
Results 1 to 8 of 8

Delete rows based on a set of cells in the same order

  1. #1
    Registered User
    Join Date
    04-14-2017
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac
    Posts
    4

    Delete rows based on a set of cells in the same order

    Hi everyone,

    I have a huge list of 17.000 URLs which I have to clean up. The list contains several 'blocks' which contain the same URLs in the same order, e.g.:

    URL 1
    URL 1
    URL 2

    I would like Excel to go through the list (column) and delete the rows where this 'block' is found, so all three rows of this block should be removed. These blocks vary from 3 URLs to 90 URLs. Is it possible to let Excel do this for me? And if so, how can I achieve it.

    I am not an Excel expert, so I am not familiar with macros/VB (although I am open to learn about it of course!)

    With kind regards,
    Iljoesjin

  2. #2
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Delete rows based on a set of cells in the same order

    Not clear what do you mean by 'block' here?. Make your question more clear. Attach a sample workbook( not with 17000 URLs of course).Desensitize the data.Show some desired results manually there.


    Post a WORKBOOK. scroll down to the Manage Attachments button), browse to the required file, and then push the Upload button.
    Teach me Excel VBA

  3. #3
    Registered User
    Join Date
    04-14-2017
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac
    Posts
    4

    Re: Delete rows based on a set of cells in the same order

    Hi ImranBhatti,

    Please see the file attached, the first sheet shows the original list with the 'blocks' marked in red. These should be removed from the list, as shown on the second sheet. In the example is used a block of 3 URLs, in the real list I also have blocks from 90 URLs which have to be removed.

    I hope this clarifies things, otherwise please let me know what additional information you need.

    With kind regards,
    Iljoesjin
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Delete rows based on a set of cells in the same order

    Yes some more information is required

    Is it the number on the right that if that is from 1 to 90 then you want to delete that url ?

    OR

    there is some other identity for the urls to delete ?

  5. #5
    Registered User
    Join Date
    04-14-2017
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac
    Posts
    4

    Re: Delete rows based on a set of cells in the same order

    I replaced the actual URLS with 'URL #' in the example, so in the real version the identifier will probably be the full URL since they belong to the same domain. So for the 'block' of 90 it will mean 90 different URLS in a specific order.

    I hope this answers your question.

  6. #6
    Valued Forum Contributor ImranBhatti's Avatar
    Join Date
    03-27-2014
    Location
    Rawalpindi,Pakistan
    MS-Off Ver
    Office 365
    Posts
    1,784

    Re: Delete rows based on a set of cells in the same order

    URLs involve strings
    They need to be split for analysis. It is hard to determine which url to be deleted.

    Any chance you could upload a workbook with maximum 20 to 30 urls ? (if you think they are not sensitive)

  7. #7
    Registered User
    Join Date
    04-14-2017
    Location
    Netherlands
    MS-Off Ver
    Excel for Mac
    Posts
    4

    Re: Delete rows based on a set of cells in the same order

    I am afraid that is too sensitive indeed. Perhaps this background information helps: I used a spider tool to crawl a website on its pages and the connections between them and this was exported into a .csv file. The tool also shows all links to the pages in the top navigation and footer of the pages, I want to eliminate those because they are not relevant for my research (since they are available for every page).

    Example URLs:
    http://www.company.com/main/products/product-type1.html
    http://www.company.com/main/products/product-type2.html
    http://www.company.com/main/products/product-type3.html
    http://www.company.com/main/products/product-type4.html
    ... (this goes on for about 20 product categories)
    http://www.company.com/main/application1.html
    http://www.company.com/main/application2.html
    http://www.company.com/main/application3.html
    http://www.company.com/main/application4.html
    ... (this goes on for about 30 application areas)
    http://www.company.com/main/support/faq.html
    http://www.company.com/main/support/warranty.html

    The order and amount of URLs is always the same since, the top navigation menu (and footer) do not change per page.

    I hope this helps, otherwise I will do it manually (but that would take a lot more time). Thanks anyways!

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

    Re: Delete rows based on a set of cells in the same order

    Here is an array entered formula* that will return the desired results for the example spreadsheet attached to post #3:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    *Array entered formulas are activated by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer.
    Looking at the example URL's in post #7, if there exist similarities in the URL's that should not be included in the result, such as "-type#" and/or "application#" then there may be a way to write a formula to filter those out. It would really help to get a file that is as close to the actual data as possible, without disclosing sensitive information.
    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.

+ 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] how to delete rows based on duplicate cells
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 01-26-2016, 03:53 PM
  2. Delete rows based on multiple cells
    By ninjarama100 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-20-2012, 08:17 PM
  3. Delete rows based on value in cells
    By dws123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2010, 06:59 PM
  4. Need to delete cells, not columns or rows, based on LEN=0
    By jenny_journalist in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-29-2009, 04:11 PM
  5. Delete row based on comparing 2 cells in a certain order.
    By rfedeleo in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2009, 12:48 AM
  6. delete rows based on cells having a floating pix
    By GottaRun in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-18-2006, 07:20 PM
  7. List rows in an order based on a cells value
    By Josh M in forum Excel General
    Replies: 0
    Last Post: 09-14-2005, 12:05 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