+ Reply to Thread
Results 1 to 7 of 7

Compare two columns and get result from third

  1. #1
    Registered User
    Join Date
    03-21-2017
    Location
    London
    MS-Off Ver
    10
    Posts
    7

    Compare two columns and get result from third

    Hi all.. hope you are all well... PFA.

    I need to compare two columns and get the result from third column. Attached is the example information I am looking for.

    If there are multiple matches then it has to go by ascending order and display the results in Ascending order.

    From the attached:
    1. Compare B & C and if they Match Provide A2
    2. Consider "Who" in B2 and B10
    -- It should first compare with first "Who" in C4 and provide respective A4 - as 4
    3. Then "Who" in B10 should search for its match after C4 only and bring that match - like
    -- B9 & C10 match now - result should be 9

    There might be multiple same values in Column B & C but then it has to go based on ascending order and provide the next value but not consider the first.

    Any help is appreciated.

    Regards,
    R
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Compare two columns and get result from third

    That makes absolutely no sense to me at all!!! Please explain again. It began with 1. Compare B & C and if they Match Provide A2 . B2 and C23 do NOT match, yet you have the value from a2 in column E.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  3. #3
    Registered User
    Join Date
    03-21-2017
    Location
    London
    MS-Off Ver
    10
    Posts
    7

    Re: Compare two columns and get result from third

    Hi Glenn... Sorry for the confusion... here is the detailed explanation and new doc attached....

    1. Compare B & C columns. so, C2 is "Where" .. look for "Where" in Column B .. There is a match(C9). so .. In Column E1 I need the result as 1(which is in A9). So it compares C2 value with all vales in B Column and gives the result at first Match.

    2. Similarly, Compare B & C columns. C3 is "What". look for "What" in Column B. There are 2 matches basically(B2 & B11). In Column E2 it should provide the result as 1(which is in A2 as the first match).
    Now, again Compare B & C columns. C6 is "What" again. Now this time It should start looking for match in Column B by ignoring the first "What" in Column B2 and search further up. Then we do have a match in B11. so, the result in this case is 10.

    So, if there is a match already found then the next time if it appears it should ignore the first match and start searching again.

    Hope I am clear now. Attached updated Doc. Please ignore the previous attachment.

    Regards,
    R
    Attached Files Attached Files

  4. #4
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Compare two columns and get result from third

    Much clearer!! i follow it completely.

    In E2, an array formula, copied down:

    =INDEX(A:A,SMALL(IF($B$2:$B$11=C2,ROW($B$2:$B$11)),COUNTIF($C$2:C2,C2)))

    Array Formulae are a little different from ordinary formulae in that they MUST be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER.

    You will know the array is active when you see curly brackets { } - or "curly braces" for those of you in the USA, or "flower brackets" for those of you in India - appear around the outside of your formula. If you do not use CTRL+SHIFT+ENTER you will (almost always) get an error message or an incorrect answer. Press F2 on that cell and try again.

    Don't type the curly brackets yourself - it won't work...
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    03-21-2017
    Location
    London
    MS-Off Ver
    10
    Posts
    7

    Re: Compare two columns and get result from third

    Thanks much for the quick reply Glenn... appreciate it...

    Will check it out tomorrow and confirm.

    Regards,
    R

  6. #6
    Registered User
    Join Date
    03-21-2017
    Location
    London
    MS-Off Ver
    10
    Posts
    7

    Re: Compare two columns and get result from third

    It works absolutely fine Glenn...

    thanks and much appreciate your help.. I too call it as "Curly Braces" FYI... :-)

    have a good weekend... it reduced my weeks work to 2 days....
    Last edited by rgoli6; 03-25-2017 at 11:13 AM.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    43,984

    Re: Compare two columns and get result from third

    RU a Gringo by extraction?? Don't tell the boss that you only need two days...

    Anyway, glad it works, and thanks for the Rep.

+ 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] Compare two columns and output a result
    By Alidamalang110 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-11-2015, 01:06 PM
  2. please help with compare two columns and give me result?
    By tomislav91 in forum Excel General
    Replies: 3
    Last Post: 01-24-2015, 02:48 PM
  3. [SOLVED] Evaluate to columns; compare two columns and return result
    By kjxavier in forum Excel General
    Replies: 2
    Last Post: 09-25-2014, 04:08 AM
  4. Compare two columns and result in the third.
    By Marlize in forum Excel General
    Replies: 7
    Last Post: 04-30-2014, 02:03 PM
  5. Excel 2007 : Compare 2 columns and produce 1 result
    By fentontech in forum Excel General
    Replies: 3
    Last Post: 11-04-2011, 02:26 PM
  6. compare 2 columns and result in 3th column
    By danusko in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 10-08-2009, 06:53 AM
  7. compare two columns, then calculate a result
    By dazp1970 in forum Excel General
    Replies: 9
    Last Post: 12-11-2005, 09:45 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