+ Reply to Thread
Results 1 to 15 of 15

Find a value combining two criteria (formulas)

  1. #1
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Exclamation Find a value combining two criteria (formulas)

    Greetings,

    I am having several problems with creating a formula.
    I am performing a pairwise comparison (eg. Criteria 1 vs Criteria 2, 3, 4... / Criteria 2 vs Criteria 3, 4, 5... / Criteria 3 vs Criteria 4, 5, 6, etc).

    Explanation:
    - Columns A and F have the weights of each criterion (naturally, there are duplicates values)
    - The column "H" has the division of scores C/D

    I need to create these two formulas:

    1) I need to select the value in column "H" that meet two criteria: Correspond to the row of the Criteria in column "B" with the highest weight in "A" PLUS Correspond to the row of the Criteria in column "E" with the SECOND highest weight in "F".
    For example, if Criterion 4 has the highest weight in column A and Criterion 8 has the SECOND highest weight in Column F, I need a formula to automatically get that 1/2 in column "H"

    2. I need to select the value in column "H" that meet two criteria: Correspond to the row of the Criteria in column "B" with the SECOND highest weight in "A" PLUS Correspond to the row of the Criteria in column "E" with the THIRD highest weight in "F".

    This task is very urgent and I would really appreciate your help!
    Attached Files Attached Files
    Last edited by ctorohuamanchumo; 04-13-2021 at 02:01 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find a value combining two criteria (formulas)

    For 1st and 2nd highest
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For 2nd and 3rd highest
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I get 1/3 and 1/6 respectively (Rows 27 and 17)
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  3. #3
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Quote Originally Posted by ChemistB View Post
    For 1st and 2nd highest
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    For 2nd and 3rd highest
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I get 1/3 and 1/6 respectively (Rows 27 and 17)
    Thank you very much for your answer!

    I have two doubts:
    For 1st and 2nd highest I also get 1/3. However, I think it should be 1/2 (row 30).
    Explanation: The 1st highest value for Criteria in Column B is 0.128865671. The 2nd highest value for Criteria in column E (for THIS 0.128865671 in column A) is 0.129372485. The value of 0.357178132 is the 1st highest. Hence, I get C30 / D30 --> 1/2.
    Could you help me, please?

    For 2nd and 3rd highest, I didn't get 1/6. I got 1/3. But I think this 1/3 is correct.

    Thanks in advance!
    This is very important for me, because I need to get 10 values:
    1st highest (reference Column A) and 2nd highest (reference Column F)
    1st highest (reference Column A) and 3rd highest (reference Column F)
    1st highest (reference Column A) and 4th highest (reference Column F)
    1st highest (reference Column A) and 5th highest (reference Column F)
    2nd highest (reference Column A) and 3rd highest (reference Column F)
    2nd highest (reference Column A) and 4th highest (reference Column F)
    2nd highest (reference Column A) and 5th highest (reference Column F)
    3rd highest (reference Column A) and 4th highest (reference Column F)
    3rd highest (reference Column A) and 5th highest (reference Column F)
    4th highest (reference Column A) and 5th highest (reference Column F)

    I believe that if I have the formulas for the 1 and 2, I could perform the remaining ones...
    Last edited by ctorohuamanchumo; 04-14-2021 at 09:25 AM.

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find a value combining two criteria (formulas)

    Okay, so you want the 2nd highest value in F in the group that has the first highest value in A, not just the 2nd highest value. Is that correct?

  5. #5
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Quote Originally Posted by ChemistB View Post
    Okay, so you want the 2nd highest value in F in the group that has the first highest value in A, not just the 2nd highest value. Is that correct?
    Yes!

    Actually, I want the same for the other example (2nd and 3rd highest). I mention this because I ran the formulas with the full data in my sheet, and I did not get the correct values.

    I am attaching the updated datasheet.

    Thanks again!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Any help, please?

  7. #7
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    I need a formula that could find the value in column "H" (goes from H3 to H83) that meet these criteria:
    Correspond to the row of the Criteria in column "B" with the highest weight overall in "A" PLUS Correspond to the row of the Criteria in column "E" with the SECOND highest weight in "F". It is important to mention that I want the 2nd highest value in F in the group that has the first highest value in A, not just the 2nd highest value overall.
    For example, if Criterion 1 has the highest value, I would search for the second-highest value among those rows for Criteria 1. In this case, it would be row 9 (Criterion 8). Hence, the formula should give me the value 1/3.

    Similarly, I need a formula that could find the value in column "H" that meet these criteria:
    Correspond to the row of the Criteria in column "B" with the SECOND highest weight overall in "A" PLUS Correspond to the row of the Criteria in column "E" with the THIRD highest weight in "F".
    It is important to mention that, I want the 3rd highest value in F in the group that has the second highest value in A, not just the 3rd highest value overall.
    For example, if Criterion 2 has the second-highest value overall, I would search for the third-highest value among those rows for Criteria 2. In these case, it would be row 14 (Criterion 4). Hence, the formula should give me the value 1/7.

    I believe that if I have the formulas for these, I could perform the remaining ones...

    Thanks in advance,

  8. #8
    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,351

    Re: Find a value combining two criteria (formulas)

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however it has been brought to our attention that the same query has been posted on one or more other forums and you have not provided the required cross-post link(s) here.

    Please see Forum Rule #3 about cross-posting and adjust accordingly. Read this to understand why we (and other sites like us) consider this to be important.

    (Note: this requirement is not optional. As youy are new, I'll do it for you this time: https://www.mrexcel.com/board/thread...mulas.1168026/.)
    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.

  9. #9
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Dear AliGW,

    Thank you very much for your time and advice.
    I really need help with these tasks...

    Carlos J.

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

    Re: Find a value combining two criteria (formulas)

    Did you understand the rule? Everyone here needs help, and everyone has to abide by our rules. No exceptions and no excuses. Thanks.

  11. #11
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9
    Yes, I've already put the cross-link in the other forum.
    Last edited by AliGW; 04-14-2021 at 10:53 AM. Reason: PLEASE don't quote unnecessarily!

  12. #12
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Find a value combining two criteria (formulas)

    This formula requires you sort your column A weights lowest to highest.

    Okay, I made a small table in J:L where J contains your required ranking for Col A, K has your ranking for Column F and L has your result.
    In L3 copied down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    I spot checked it and appears to be working.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Thank you very much for your help!

    I have checked the results, and it seems that for the first five comparisons are okey (1vs2, 1vs3, 1vs4, 1vs5). However, for the remaining ones I detected some errors. For example, for the comparison 2vs3 it should be 2... I have updated some formulas and search for the correct values. I am attaching a new file where I put what should be the values that should be obtained.

    At this point, I would like to take a moment to thank you for all your help.
    I appreciate it very much!
    Attached Files Attached Files

  14. #14
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,447

    Re: Find a value combining two criteria (formulas)

    First, I think of getting a unique distinct list of "Criteria" first. The list could be extracted into somewhere in worksheet, or using offset.
    I tried using offset.
    I found out that with column B starts with "Criterio 1" (row #39), the corresponding "weight" in column F wil be running from criterio 2 to criterio 10, then F39:F47 should be unique list of weight. Correct me if the actual data said "no".
    this is unique list:
    OFFSET($F$2,MATCH("Criterio 1:*",$B$3:$B$100,0),,10,)

    Then, with J1 contains column A ranking, K1: column F ranking (actuallly, K1+1, include A ranking)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Quang PT

  15. #15
    Registered User
    Join Date
    04-13-2021
    Location
    Peru
    MS-Off Ver
    2016
    Posts
    9

    Re: Find a value combining two criteria (formulas)

    Thank you very much!

    I was doing some simulations with the new datasheets and it seems that everything is ok!

+ 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] Combine 3 columns of formulas into one formula/column.
    By rtordai in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 03-24-2020, 12:15 PM
  2. [SOLVED] VBA combine two column to find the parent item
    By isasa74 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 12-06-2016, 03:55 PM
  3. Combine 2 formulas, to find top X number of values in a table
    By BenHatton in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-13-2016, 09:16 AM
  4. [SOLVED] Need Formulas That Organize and Combine Column Headings
    By artiststevens in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-18-2013, 06:42 PM
  5. How to find all unique values then combine in a new column?
    By terry mardi in forum Excel General
    Replies: 3
    Last Post: 07-09-2013, 10:20 AM
  6. I need to combine 2 formulas in Excel
    By trpatterson3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-12-2011, 11:17 AM

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