+ Reply to Thread
Results 1 to 13 of 13

New filter function with multiple criteria

  1. #1
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    New filter function with multiple criteria

    I am using this formula which works fine, but need to add one more condition
    (date condition)

    =FILTER(INDEX(Table2,SEQUENCE(ROWS(Table2)),{14,2,3,12,13}),(Table2[Column2]>=$C$13)*(Table2[Column2]<=$E$13))


    Please see the attached file.

    Thank you.
    Attached Files Attached Files

  2. #2
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,223

    Re: New filter function with multiple criteria

    Please try

    =FILTER(INDEX(Table2,SEQUENCE(ROWS(Table2)),MID(CONCAT(14,TEXT(MATCH(C12,A1:N1)+{0,1},"00"),1213),SEQUENCE(,5,,2),2)),(Table2[Column2]>=$C$13)*(Table2[Column2]<=$E$13))

    The Calculation option is set to Manual, Press F9 to calculate.
    Attached Files Attached Files

  3. #3
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    Dear Bo_Ry,
    Thank you but the output is not working when the dates / price data is changed. Also, this is sample
    data, the actual table has more columns...from the formula I can't figure out the column numbers

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,924

    Re: New filter function with multiple criteria

    @mikehk

    Exasperating!!!

    You have been a member here long enough to know that:

    1. Your sample data MUST accurately reflect the real data you are using.
    2. If you are going to need to change anything, you need to declare this at the very beginning

    So don't use the emoji because the problems are entirely of your making and you are wasting people's time. Get your act together, please!!!
    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. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    My apologies if I was not clear from the beginning.

    The sample data is the actual format I will be using for my real data...just the numbers are different.
    My formula that used column numbers are very clear, it would just be more or less, instead of putting all columns
    I chose to put a few, the real issue is the date part in the formula.
    My sample formula uses 2 criteria and both work well, just need to add 1 more criteria (the date part).

    I can't thank enough for all the help I have received in this forum.

    Thanks again.

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2507 (Windows 11 Home 24H2 64-bit)
    Posts
    91,924

    Re: New filter function with multiple criteria

    Have you included EVERYTHING this time? Where is the updated sample workbook?

    I can't thank enough for all the help I have received in this forum.
    Great, but it all comes for free, and your gratitude does not excuse poor preparation on your part, sorry.

  7. #7
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    The new file attached, please have a look, hope my request is clear.

    Thanks again.
    Cheers.
    Attached Files Attached Files

  8. #8
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,223

    Re: New filter function with multiple criteria

    Try

    =FILTER(INDEX(Table2,SEQUENCE(ROWS(Table2)),MID(CONCAT(COLUMNS(Table2),TEXT(MATCH(C15,A1:N1)-{1,0},"00"),COLUMNS(Table2)-{2,1}),SEQUENCE(,5,,2),2)),(INDEX(Table2,,MATCH(C15,A1:N1)-1)>=$C$16)*(INDEX(Table2,,MATCH(C15,A1:N1)-1)<=$E$16))
    Attached Files Attached Files

  9. #9
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    Thank you so much Bo_Ry, your formula works as desired.

    I have a question though, may I know which part of the formula I need to change if I add or remove columns.
    for example.. I add few columns at the beginning of the table and it works fine, but adding columns at the end of
    the table gives a different result.

    Not that I intend to add columns now, but would appreciate if I know which part of the formula to change so that I
    can do so as and when required in the future.

    Please see the attached file.

    Thanks a lot.
    Attached Files Attached Files

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,223

    Re: New filter function with multiple criteria

    Last Try, change in the red

    =FILTER(INDEX(Table2,SEQUENCE(ROWS(Table2)),MID(CONCAT(COLUMNS(Table2)-1,TEXT(MATCH(G15,A1:R1)-{1,0},"00"),COLUMNS(Table2)-{3,2}),SEQUENCE(,5,,2),2)),(INDEX(Table2,,MATCH(G15,A1:R1)-1)>=$G$16)*(INDEX(Table2,,MATCH(G15,A1:R1)-1)<=$I$16))

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

    Re: New filter function with multiple criteria

    I have a question though, may I know which part of the formula I need to change if I add or remove columns.
    for example.. I add few columns at the beginning of the table and it works fine, but adding columns at the end of
    the table gives a different result.

    Not that I intend to add columns now, but would appreciate if I know which part of the formula to change so that I
    can do so as and when required in the future.
    Clearly NO understanding of post #4 at all!!!

    You really MUST state everything you want in the OPENING POST. This continual adding of requirements is not fair on your helpers. Stop doing this, please.

  12. #12
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    Kindly note that it's not continual adding of requirements, just trying to learn where the formula can be modified so I can do it
    without asking for further help.

    Thank you once again. Highly appreciate all the help.

  13. #13
    Forum Contributor mikehk's Avatar
    Join Date
    09-05-2017
    Location
    Hong Kong
    MS-Off Ver
    Office 365
    Posts
    483

    Re: New filter function with multiple criteria

    Thank you Bo_Ry. You are a gem.




    Quote Originally Posted by Bo_Ry View Post
    Last Try, change in the red

    =FILTER(INDEX(Table2,SEQUENCE(ROWS(Table2)),MID(CONCAT(COLUMNS(Table2)-1,TEXT(MATCH(G15,A1:R1)-{1,0},"00"),COLUMNS(Table2)-{3,2}),SEQUENCE(,5,,2),2)),(INDEX(Table2,,MATCH(G15,A1:R1)-1)>=$G$16)*(INDEX(Table2,,MATCH(G15,A1:R1)-1)<=$I$16))

+ 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] FILTER function with multiple criteria
    By mikehk in forum Excel General
    Replies: 14
    Last Post: 08-29-2020, 08:59 AM
  2. Replies: 0
    Last Post: 08-04-2017, 02:39 AM
  3. Using a function to filter on two criteria
    By elouise_everett in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-09-2017, 04:51 PM
  4. Need to filter multiple criteria in Label Filter
    By brassellc7994 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-04-2013, 12:54 PM
  5. How do I use multiple criteria in the filter function
    By TheVolkinator in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 12-10-2012, 01:18 AM
  6. Replies: 2
    Last Post: 06-15-2012, 05:34 PM
  7. filter function with criteria
    By bklim in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-15-2007, 11:18 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