+ Reply to Thread
Results 1 to 6 of 6

Filter dynamic array to keep rows which include conditional minimum values

  1. #1
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    202

    Filter dynamic array to keep rows which include conditional minimum values

    Hi,

    I have a dynamic array, like this:

    14.11.2018 A B C
    15.11.2018 A B C
    16.11.2018 D E F
    17.11.2018 D E F
    20.11.2018 G H I

    The table contains duplicates relative to columns B, C and D, but the dates in column A for those duplicates will differ. For each set of duplicate rows with regards to columns B, C and D, I need to filter out duplicates and keep only the row within each duplicate set which contain the lowest value in column A for the set.

    The resulting table will then look something like this:

    14.11.2018 A B C
    16.11.2018 D E F
    20.11.2018 G H I

    Does anybody have a dynamic array solution to this? Please see attached workbook.

    Best regards,
    Marbleking

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,469

    Re: Filter dynamic array to keep rows which include conditional minimum values

    Somewhere new on your worksheet try this:

    =FILTER($A$3:$D$7,$A$3:$A$7=MINIFS($A$3:$A$7,$B$3:$B$7,B3:B7,$C$3:$C$7,C3:C7,$D$3:$D$7,D3:D7),"")

    Make sure there is no data in the space below.
    Ali


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


    Forum Rules (updated September 2018): please read them here.
    How to use the Power Query code you've been given: help here. More about the Power suite here.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,469

    Re: Filter dynamic array to keep rows which include conditional minimum values

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of all those who offered help.

  4. #4
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    202

    Re: Filter dynamic array to keep rows which include conditional minimum values

    Hi, AliGW

    Thank you for the formula. I am trying to use a modified version of it that looks like this:

    =FILTER($A$3:$D$7,$A$3:$A$7=MINIFS(INDEX($A$3:$D$7,,1),INDEX($A$3:$D$7,,2),INDEX($A$3:$D$7,,2),INDEX($A$3:$D$7,,3),INDEX($A$3:$D$7,,3),INDEX($A$3:$D$7,,4),INDEX($A$3:$D$7,,4)),"")

    This formula works fine for the data set that was provided. However, when I try to apply this solution to the actual data that I am working on, which becomes a bit more complex, the formula gives a #VALUE! error:

    =FILTER(SORT(UNIQUE(CHOOSE({1\2\3\4},SAP[Created on],SAP[Batch],SAP[Material],SAP[Material Description])),{1\2}),INDEX(SORT(UNIQUE(CHOOSE({1\2\3\4},SAP[Created on],SAP[Batch],SAP[Material],SAP[Material Description])),{1\2}),,1)=MINIFS(INDEX(SORT(UNIQUE(CHOOSE({1\2\3\4},SAP[Created on],SAP[Batch],SAP[Material],SAP[Material Description])),{1\2}),,1),INDEX(SORT(UNIQUE(CHOOSE({1\2\3\4},SAP[Created on],SAP[Batch],SAP[Material],SAP[Material Description])),{1\2}),,2),INDEX(SORT(UNIQUE(CHOOSE({1\2\3\4},SAP[Created on],SAP[Batch],SAP[Material],SAP[Material Description])),{1\2}),,2)),"")

    Can you see any reason for this failing? (PS: This last formula only uses the second column of the data as criterion, but that's intended).

    Regards,
    Marbleking

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Ipswich, England
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel (Windows 11 64-bit)
    Posts
    60,469

    Re: Filter dynamic array to keep rows which include conditional minimum values

    There are instructions at the top of the page explaining how to attach your sample workbook.

  6. #6
    Forum Contributor
    Join Date
    08-20-2011
    Location
    Oslo
    MS-Off Ver
    MS 365
    Posts
    202

    Re: Filter dynamic array to keep rows which include conditional minimum values

    Hi,

    Please see attached workbook. I'd like to get the formula in K23 right. Currently it yields #VALUE!. The formula uses CHOOSE to select columns to work with and then INDEX to separate singular columns from this selection.

    Regards,
    Marbleking

+ 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. Replies: 18
    Last Post: 02-12-2019, 01:39 PM
  2. [SOLVED] PivotTable: filter to only include top five of values in a values column
    By adh2 in forum Excel Charting & Pivots
    Replies: 3
    Last Post: 12-03-2015, 02:02 PM
  3. Set filter to EXCLUDE values rather than include them
    By Uther_d_dragon in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-21-2013, 10:54 AM
  4. Find minimum for all values with same identifier within an array
    By dhs in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-13-2011, 10:48 PM
  5. Replies: 9
    Last Post: 07-17-2009, 04:18 PM
  6. [SOLVED] minimum along rows:creates an array
    By Robert_Steel@nothanks.com in forum Excel Formulas & Functions
    Replies: 39
    Last Post: 09-06-2005, 09:05 PM
  7. [SOLVED] Finding minimum value across selected rows of an array
    By Dazed and confused about min, max in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-25-2005, 08:06 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