+ Reply to Thread
Results 1 to 20 of 20

2 criteria matched formula

  1. #1
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    2 criteria matched formula

    Hi Experts,
    I have created excel file, I need formula in yellow highlighted box, type will be autocomplete type which most nearest criteria matched, you will be understand when you see excel file and screenshots, any expert assist me.

    Thanks in advance,
    Farhangul
    Attached Images Attached Images
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    Array formula (CSE) in H2:

    =(INDEX($A$3:$A$22,MATCH(MINIFS($B$3:$B$22,$B$3:$B$22,">="&F2)&MINIFS($C$3:$C$22,$C$3:$C$22,">="&G2),$B$3:$B$22&$C$3:$C$22,0))

  3. #3
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    Hi leo,
    Thanks for helping, formula is showing error "your formula is missing parenthesis--)"

  4. #4
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    and I'm using excel 2007

  5. #5
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    Hi leo, formula is not working, I'm using 2007 excel

  6. #6
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    Array formula in H2 (CTRL+SHIFT+ENTER)

    =INDEX($A$3:$A$22,MATCH(MIN(IF($B$3:$B$22>=F2,$B$3:$B$22))&MIN(IF($C$3:$C$22>=G2,$C$3:$C$22)),$B$3:$B$22&$C$3:$C$22,0))
    Last edited by LeoSkywalker; 11-02-2018 at 07:30 PM.

  7. #7
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    Hi,
    formula still is not working properly, closet number type is not coming,like 2, 8 closet number of criteria 2,9 but it is not showing correct type here should be D2s_v3 but it is showing E2s_v3
    Attached Images Attached Images

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: 2 criteria matched formula

    Try
    =INDEX($A$3:$A$22,MATCH(MIN(IF($B$3:$B$22>=F2,$B$3:$B$22-F2,10^35)+IF($C$3:$C$22>=G2,$C$3:$C$22-G2,10^35)),
    IF($B$3:$B$22>=F2,$B$3:$B$22-F2,10^35)+IF($C$3:$C$22>=G2,$C$3:$C$22-G2,10^35),0))

  9. #9
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    It won't work, try the pair (33,129), it should return D32s_v3(32,128), however it is F72s_v2(72,144)


    farhangul, how do you decide which is closest in the pair (3,12)? will it go to (2,8); (2,16); (4,8); or (4,16)?
    Also, in the pair (30,200), the closest to 30 is 20, but the closest to 200 is 160; which takes precedence? CPU or MEM?


    I made the formula in such a way that the specs in the virtual machine surpassed the examples required in both CPU and MEM, as yout first examples portrayed those answers.
    Last edited by AliGW; 11-03-2018 at 11:11 AM.

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

    Re: 2 criteria matched formula

    Please try, and press Ctrl+Shift+Enter

    I2 more priority for CPU
    =INDEX($A$3:$A$22,MATCH(MIN(ABS($B$3:$B$22-F2)*5^5+ABS($C$3:$C$22-G2)),ABS($B$3:$B$22-F2)*5^5+ABS($C$3:$C$22-G2),))

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,899

    Re: 2 criteria matched formula

    1. Sort CPU -> Smallest to Largest.

    2. Sort MEM -> Smallest to Largest.

    3. Use formula:

    =INDEX($A$3:$A$22,MATCH(1,INDEX(($B$3:$B$22>=F2)*($C$3:$C$22>=G2),0),0))
    Attached Files Attached Files

  12. #12
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    Pair (33,129) should return D32s_v3(32,128), however it still returns F72s_v2(72,144); and if you change sorting to CPU after MEM, it will return D64s_v3 (64,256).

  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,430

    Re: 2 criteria matched formula

    Leo - please don't quote whole posts, especially when you are responding to the one immediately preceding your own - it's just clutter. It's OK to quote if you are responding to a post out of sequence, but limit quoted content to a few relevant lines that makes clear to whom and what you are responding. Thanks!

    For normal conversational replies, try using the QUICK REPLY box below.
    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.

  14. #14
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    @Bo_Ry,

    Pairs:
    32 128
    31 127
    31 129
    33 127
    33 129

    Should all return D32s_v3 (32,128) as they are the closest.
    Results in the formula change according to the sorting, but there are several different results.

    @AliGW, Ali, sorry, my bad.
    Last edited by LeoSkywalker; 11-03-2018 at 11:31 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,430

    Re: 2 criteria matched formula

    Leo - see post #13. Please do not ignore a moderator's requests. Thanks.

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

    Re: 2 criteria matched formula

    My sheet get all D32s_v3

    Please see attached
    Attached Files Attached Files

  17. #17
    Forum Contributor
    Join Date
    10-08-2018
    Location
    Lima, Peru
    MS-Off Ver
    Office 365 ProPlus
    Posts
    148

    Re: 2 criteria matched formula

    That's correct Bo, it's working, waiting for the OP to say OK.

    AliGW
    Leo - see post #13. Please do not ignore a moderator's requests. Thanks.
    Ali, please see #14, You're welcome, but I didn't ignore you request, I had edited my previous post to reflect that I had seen it. I'm sorry the page didn't refresh quick enough to see it as I was editing first, as new messages doesn't seem to appear automatically if you're reading the page.
    Last edited by LeoSkywalker; 11-03-2018 at 11:56 AM.

  18. #18
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    Hi Bo_RY,
    I have put your formula but it is only taking type by criteria minimum, I need formula which will be minimum OR maximum closet, can you help on this?

  19. #19
    Forum Contributor
    Join Date
    01-23-2016
    Location
    karachi
    MS-Off Ver
    2007
    Posts
    316

    Re: 2 criteria matched formula

    Hi Leosky,
    I have put your formula but it is also only taking type by criteria minimum, I need formula which will be minimum OR maximum closet, can you help on this?

  20. #20
    Forum Contributor
    Join Date
    09-10-2010
    Location
    europe
    MS-Off Ver
    Excel 2007
    Posts
    149

    Re: 2 criteria matched formula

    Hello farhangul

    What are the maximum values for the CPU / MEM?
    Is it always the CPU less than the MEM?
    I think you first have to set all the conditions with expected results.
    This would make it easier to find a formula.
    What are the results if the criteria are following below?
    Are such conditions possible?

    1. CPU 63 / MEM 5
    2. CPU 62 / MEM 11
    3. CPU 16 / MEM 8

    regards
    Attached Files Attached Files

+ 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] Subtract only the matched criteria from row amount
    By Neilesh Kumar in forum Excel General
    Replies: 2
    Last Post: 11-11-2016, 01:08 PM
  2. [SOLVED] Formula to Return most recent date when criteria are matched
    By lkndllsgrl in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 11-12-2015, 11:36 AM
  3. increment number if criteria is matched
    By faisalmalak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2013, 05:11 AM
  4. [SOLVED] Excel 2007 : Hlookup if two criteria are matched
    By CatherineCarey in forum Excel General
    Replies: 3
    Last Post: 04-25-2012, 02:37 PM
  5. Delete Columns if Criteria matched.
    By JapanDave in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-20-2011, 07:38 AM
  6. Average if two criteria matched
    By Actual in forum Excel General
    Replies: 2
    Last Post: 04-07-2009, 10:10 AM
  7. SUMPRODUCT Formula to Count Row of data Below Matched Criteria
    By Sam via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 02-02-2005, 10: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