+ Reply to Thread
Results 1 to 17 of 17

How to search and remove a series of entries based on adjacent values.

  1. #1
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    How to search and remove a series of entries based on adjacent values.

    Good morning,

    I can't seem to solve my current formula problem.

    I want to search two columns of data, and delete certain series of entries based on the average of the entries in the adjacent column.

    Please see attached excel for example.

    Thanks in advance for any help that may come!
    Attached Files Attached Files

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    In B4 Cell

    =IF(ISNUMBER(SEARCH("Series",A4)),A4,B3)

    In E4 Cell

    =IF(VLOOKUP(B4,$A$4:$D$29,4,0)<20,"Delete","Retain")

    Drag both the formula's down....

    Apply filter for 3rd Row and in E3 Cell Expand the Auto filter drop down and select Delete and delete the selected records


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Thanks for the quick reply!

    But sorry, I don't usually have the entries in Column A, so it can't be referenced in the formula.
    I always only have columns C and D to work with.

    [I manually entered Column A entries to highlight what each "series" was]

    Is there a formula that can be used referencing only Column C and D?

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    Please describe then how you will identify which data belongs to which one? By adding an attachment by showing your actual structure of your data.

  5. #5
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    The formula would have to detect all instances of entries including the same XXXXX-XXX and treat them as one "series".

    I have reattached the excel with only the usable data entered.

    Thanks for your trouble.
    Attached Files Attached Files

  6. #6
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    In C6 Cell

    =IFERROR(MID(A6,FIND("-",A6)+1,FIND("-",A6,FIND("-",A6)+1)-FIND("-",A6)-1),"")

    In D6 Cell

    =IFERROR(IF(INDEX($B$6:B6,MATCH(LEFT(A6,FIND("-",A6)-1)&"-"&C6&"-1",$A$6:A6,0))<20,"Delete","Retain"),"-")

    Drag both the formla's down...

  7. #7
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Wow. That's almost perfect.

    In row 2 I noted [There may be various hyphens/numbers/letters joined to the right.]

    In row 6 to 10 I changed the cell A number adjoined to the right of *****-*** to a letter. The formula only returns a hyphen in cell D in this case. Can it be adjusted to return [Retain] even though the letters are joined in cell A?

    Please see attached excel.
    Attached Files Attached Files

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    That's why we ask for exact structure of data to avoid unnecessary folloups....

    In D6 Cell

    =IFERROR(IF(INDEX($B$6:B6,MATCH(LEFT(A6,FIND("-",A6)-1)&"-"&C6&"*",$A$6:A6,0))<20,"Delete","Retain"),"-")

    Drag it down....

  9. #9
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Hi,

    The formula is returning [Delete] for a series if the first entry in cell B for the series is less than 20.

    e.g. Series of "15263-001" is from row 6 to row 10.
    If I change Cell B6 to "19" then [Delete] is displayed for this series in D6 to D10.

    However the average of B6,B7,B8,B9 and B10 is still above 20. (213 / 5 = 42.6)
    Because 42.6 is greater than 20 [Retain] should be displayed in D6 to D10.

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    That is not the one which you have asked in your initial thread.

    Since it is a new requirement, so please start a new thread.

  11. #11
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    In my excel attached to post # 7 I note in row 3;

    "I want to delete a series if the average of the numbers in the adjacent cell B is less than 20."

    Should I start a new thread?

    edit# also in the first post I mention "average"

    [I want to search two columns of data, and delete certain series of entries based on the average of the entries in the adjacent column.]

  12. #12
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    Ok... no need to start new thread, but please expect some delay in reply from my end!

  13. #13
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Thank you! I appreciate the help.

    And sorry for ambiguity in my request. I am not so experienced with excel....

  14. #14
    Banned User!
    Join Date
    10-29-2012
    Location
    Europe
    MS-Off Ver
    2013, 2016
    Posts
    318

    Re: How to search and remove a series of entries based on adjacent values.

    See attach.
    Is this what you want?
    Attached Files Attached Files
    Last edited by Indi_Ra; 02-14-2014 at 11:49 AM. Reason: wrong formula

  15. #15
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Hi Indi_Ra,

    Thanks for your time.

    In excel 4,
    Unfortunately it seems that your formula decides values in column B are in the same series based only on the 3 digits in the middle. i.e. 001, 002, 851.

    I need the formula to decide the series based on the 8 digits *****-*** i.e. 15263-001

    This way, if another entry in column B has for example 45455-001 , it will be judged as a separate series.

  16. #16
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: How to search and remove a series of entries based on adjacent values.

    Apply the below formula's on your Post #7 file

    In C6 Cell

    =LEFT(A6,FIND("-",A6,FIND("-",A6)+1)-1)

    In D6 Cell

    =IF(AVERAGEIF($C$6:$C$31,C6,$B$6:$B$31)<20,"Delete","Retain")

    Drag both the formula's down...

    I assume your excel version is the later version of 2003 based on your profile, so suggesting the Averageif formula.

  17. #17
    Registered User
    Join Date
    05-21-2013
    Location
    Japan
    MS-Off Ver
    Excel 2011 mac
    Posts
    17

    Re: How to search and remove a series of entries based on adjacent values.

    Brilliant!

+ 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. have vba remove values from one list based on entries from another list
    By frugal in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-11-2013, 06:36 AM
  2. fill/ remove formula based on adjacent cell value
    By sarails in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-14-2011, 10:38 PM
  3. Locating duplicate entries and concatenating adjacent values
    By justinwright in forum Excel General
    Replies: 4
    Last Post: 03-30-2011, 01:24 PM
  4. Multiple Series, Remove Zero Values
    By Janc in forum Excel Charting & Pivots
    Replies: 6
    Last Post: 11-30-2009, 07:31 AM
  5. Replies: 1
    Last Post: 03-28-2005, 06:06 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