+ Reply to Thread
Results 1 to 2 of 2

Delete rows from table based on conditions

  1. #1
    Registered User
    Join Date
    12-16-2015
    Location
    Barcelona
    MS-Off Ver
    MAC 2011
    Posts
    3

    Delete rows from table based on conditions

    I want to delete certain rows from a table.
    The conditions are : if column 1 = colum 2 ( like 1 in the example below)
    and if the combination of colum 1 and column 2 has shown up in the table before ( like 2 and 4 in the example below)

    1 Metabolite A Metabolite A
    2 Metabolite A Metabolite B
    3 Metabolite A Metabolite C
    4 Metabolite B Metabolite A
    5 Metabolite B Metabolite C

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,919

    Re: Delete rows from table based on conditions

    Assuming that these are in columns A, B and C.
    In column D make a "composite" of the two Columns: =IF(B2<C2,B2&":"&C2,C2&":"&B2) this formula concatenates them in alphabetical order. So A & B and B & A both come out as A:B.

    In column E we determine whether to keep the row. =AND(MATCH(D2,$D$1:$D$6,0)=ROW(),B2<>C2)

    The MATCH(D2,$D$1:$D$6,0)=ROW() evaluates to true for the first occurrence of the composite. the B2<>C2 part checks to see if the cells are not alike.

+ 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 Table Rows Based on Specific Text
    By gedwards913 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-10-2015, 12:47 PM
  2. [SOLVED] Extracting from table based on criteria and auto delete rows after 4 days from database
    By ACALEX in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-18-2014, 10:33 AM
  3. identifying rows to delete based on multiple conditions
    By DannyGIS in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 06-09-2014, 06:29 PM
  4. [SOLVED] Macro to Delete Rows based on Specific Conditions
    By stockgoblin42 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-28-2013, 05:29 PM
  5. [SOLVED] VBA code to delete duplicate rows based on multiple conditions
    By pjsween in forum Excel General
    Replies: 5
    Last Post: 06-27-2012, 01:15 PM
  6. Automatically Add/Delete rows based on user input but check current table row count
    By clemsoncooz in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-31-2011, 11:39 AM
  7. Delete Rows Based on Two Conditions
    By ExcelGuy160 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-20-2010, 02:44 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