+ Reply to Thread
Results 1 to 17 of 17

How to use FILTER on two columns?

  1. #1
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    How to use FILTER on two columns?

    Hi, I'm looking to solve the following:

    sample.JPG

    I've searched around a bunch but I haven't found what will do this.

    Any ideas?

    Thanks!
    Attached Files Attached Files
    Last edited by rubsley; 07-22-2021 at 04:40 PM.

  2. #2
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    PS I realise I could use SUMPRODUCT or SUMIF in each cell - but since it's going to cover over a thousand rows and up to six hundred columns I figure that would be a bit much.

  3. #3
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: How to use FILTER on two columns?

    Please see yellow banner at top of page on how to post a workbook. Please make sure it is a good representative sample,

    Are you open to a VBA solution?

    And I suspect you are not on Excel 2003 so please update your profile

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to use FILTER on two columns?

    Since you clearly have the sample data there please upload an Excel workbook here. It saves retyping your data.

    Instructions are in the gold banner titled HOW TO ATTACH YOUR SAMPLE WORKBOOK:
    Dave

  5. #5
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    Apologies. Here's the sample.
    Attached Files Attached Files

  6. #6
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,206

    Re: How to use FILTER on two columns?

    You stated there were several hundred columns: what is data format over these columns as your sample gives no indication of this : are there many pairs of names ???

  7. #7
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    Yep, it just carries on as it is: pairs of names and pairs of numbers.

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

    Re: How to use FILTER on two columns?

    Try the following in G3 (then copy over and down):
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  9. #9
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    Strangely, I just got blank cells from that.

    I think I've figured another way to go about what I needed.

    Thanks for looking though!

  10. #10
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: How to use FILTER on two columns?

    Please share your solution for the benefit of others.

    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 those who helped.
    Ali


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

    Forum Rules (updated August 2023): please read them here.

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

    Re: How to use FILTER on two columns?

    To demonstrate that the formula works.

  12. #12
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    Many thanks for the help, all good now.

    (PS The solution I mentioned was to do with what the next stage of what I wanted to do with the data, but I arrived at that step in a different way.)

    As ever, all help much appreciated.

  13. #13
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: How to use FILTER on two columns?

    And what was your solution? Please share it here for the benefit of the whole community. Thanks.

  14. #14
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    =IF(AND(A2<>"", IF(A2="", , IF(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))))="", FALSE, IF(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))))>MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B))))), TRUE, FALSE)))), COUNTIF(INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 2, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 5, 1, TRUE, "Data")), A2) - COUNTA(IFNA(FILTER(INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 2, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 2, 1, TRUE, "Data")), INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 2, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 2, 1, TRUE, "Data"))=A2, INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 6, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 6, 1, TRUE, "Data"))=0)))+COUNTA(IFNA(FILTER(INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 5, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 5, 1, TRUE, "Data")), INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))))+1, 5, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 5, 1, TRUE, "Data"))=A2, INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))))+1, 6, 1, TRUE, "Data")):INDIRECT(ADDRESS(MAX(MAX(ArrayFormula(IF((Data!B:B=A2)*(Data!C:C>Data!D:D), ROW(Data!B:B)))), MAX(ArrayFormula(IF((Data!E:E=A2)*(Data!D:D>Data!C:C), ROW(Data!B:B))))), 6, 1, TRUE, "Data"))=0))), )

    The ultimate aim was to find the length of an ongoing sequence of 1s (wins) for each name.

    Data!B:B is name 1
    Data!C:C is score 1
    Data!D:D is score 2
    Data!E:E is name 2
    A2 is name required

    It's a long formula and is actually spread over 4 cells - much more sensible like that - but that's the "one cell" version.
    Last edited by rubsley; 07-27-2021 at 11:23 AM.

  15. #15
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: How to use FILTER on two columns?

    Monstrous! And it's not an Excel formula, is it? So are you using Google Sheets? If so, you should say so when you open threads and post to the Other Platforms section.

  16. #16
    Registered User
    Join Date
    05-04-2020
    Location
    Leeds, UK
    MS-Off Ver
    2017
    Posts
    51

    Re: How to use FILTER on two columns?

    Yeah, I got a collaborator in and we ended up doing it on Sheets for easy sharing.

  17. #17
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,853

    Re: How to use FILTER on two columns?

    OK. Any further issues will need to be raise in the Other Platforms section, then.

+ 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. Excel 2016 Filter Sorting Columns With No Filter
    By klavierkatze in forum Excel General
    Replies: 5
    Last Post: 05-13-2019, 11:01 PM
  2. [SOLVED] Filter data by Columns (a,b,c etc) and mark the top 3 items for each filter.
    By margetc in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 04-15-2018, 04:18 AM
  3. Replies: 3
    Last Post: 01-18-2018, 12:20 PM
  4. Replies: 5
    Last Post: 11-24-2014, 11:58 AM
  5. Replies: 6
    Last Post: 10-16-2014, 08:42 AM
  6. Using filter to highlight/filter duplicates in multiple columns but within 1 day
    By DaveBre in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-25-2014, 04:07 AM
  7. [SOLVED] How to Filter Many Columns with One Dropdown Filter?
    By garrett.grillo in forum Excel General
    Replies: 6
    Last Post: 03-20-2014, 01:27 AM

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