+ Reply to Thread
Results 1 to 5 of 5

deleting rows based on same value of one cell

  1. #1
    Registered User
    Join Date
    06-18-2019
    Location
    Grantham, England
    MS-Off Ver
    2016
    Posts
    6

    deleting rows based on same value of one cell

    Hi

    race.png

    I am copying and pasting contents of a web page of greyhound racing into excel and want it to automatically delete rows where the historic race distances don`t match the current race card distance (A19 -275m).
    In the screen shot you will find that distance in A19 and historic race distances down column C.
    The trouble is that there is more then just the distance in the cell (Race 3*D3 - 275m Flat) so I wonder if it can still be done?

  2. #2
    Registered User
    Join Date
    10-27-2015
    Location
    Houston, Texas
    MS-Off Ver
    2013
    Posts
    6

    Re: deleting rows based on same value of one cell

    There are a few options, so let us know what exactly you want to happen:
    1. Rows that don't have correct distance are highlighted or somehow flagged so that you can see them and delete them yourself, manually.
    2. Whatever you're trying to do with this data, such as average it or something with a formula, you want the rows that don't match the correct distance to be excluded from this calculation.
    3. You want a VBA macro that will find the rows without the correct distance and delete them with a button push or something.

    Depending on what you want, the solution will look differently but all of these should be possible. As for extracting the race distance from A19, you can probably just use the SEARCH formula to find "m ". This will rely on the assumption that the source of your data will always name the races similarly. The end of the distance should follow with a space before the next word so that will be unique and allow you to zero in on where the distance is positioned in the cell value. Then you can use LEFT and RIGHT to cut the other stuff out so you're just left with "275m" for example.

  3. #3
    Registered User
    Join Date
    06-18-2019
    Location
    Grantham, England
    MS-Off Ver
    2016
    Posts
    6

    Re: deleting rows based on same value of one cell

    Hi
    Thanks for the reply!
    option 2 looks the best to me... the highlighted cells are showing top to bottom above/below average and top and bottom 10%. So I continue to copy and paste over the same sheet without having to keep setting it up but there are over 100 races a day and is tedious manually removing incorrect lines to come up with the correct distance to time averages. So if poss as soon as its pasted in preferably the lines are automatically deleted.

  4. #4
    Registered User
    Join Date
    06-18-2019
    Location
    Grantham, England
    MS-Off Ver
    2016
    Posts
    6

    Re: deleting rows based on same value of one cell

    so how do I go about doing it ?

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    19,002

    Re: deleting rows based on same value of one cell

    Here is my interpretation of what sheymyster is suggesting. The calculation excludes the rows that do not include 275m, however no rows are actually deleted.
    1. A helper column (Q) finds the rows that should be included using: =ISNUMBER(SEARCH(C4,A$2))
    2. The Average is calculated using: =AVERAGEIF(Q4:Q8,TRUE,P4:P8)
    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. Deleting Rows Based on Cell Value
    By Kevin Rush in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-05-2019, 08:06 PM
  2. Deleting rows based on a value in a cell
    By woopdidu in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-05-2015, 12:07 PM
  3. Deleting rows based on cell value
    By solnish in forum Excel Programming / VBA / Macros
    Replies: 33
    Last Post: 08-04-2015, 09:26 AM
  4. Deleting rows based on a cell value
    By thedon_1 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 12-01-2011, 08:47 AM
  5. Deleting rows based on a value in a cell.
    By Polaris11 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-06-2011, 05:14 PM
  6. deleting rows based on cell value
    By cart0250 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-16-2006, 07:19 AM
  7. Deleting rows based on a cell value
    By JPriest in forum Excel Formulas & Functions
    Replies: 37
    Last Post: 09-06-2005, 07:05 PM

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