+ Reply to Thread
Results 1 to 8 of 8

4 Columns Comparison

  1. #1
    Registered User
    Join Date
    02-08-2016
    Location
    Italy
    MS-Off Ver
    Office 2013
    Posts
    4

    Question 4 Columns Comparison

    Hi to all!

    I need to compare 4 columns like the ones in the image.

    If "A+B" contents are identical to "C+D", in the "E" i want to see the correct "REF" number (1° Column).

    If those are not identical i want to show N/A or something similar.

    http://imageshack.com/a/img921/3108/cKWoNT.png

    What solution do you suggest?
    Thanks!

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: 4 Columns Comparison

    Will the numbers ever occur more than once in the column they are in?
    If no then the numbers themselves are unique and there's no need to compare columns B and D and you can use this:

    in E1
    =MATCH(A1,C$1:C$4,0)
    and copy down the column

    else use this
    =MATCH(A1,IF(B1=D$1:D$4,C$1:C$4),0)
    Array formula, use Ctrl-Shift-Enter
    and copy down the column
    Last edited by Special-K; 02-08-2016 at 01:15 PM.
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-08-2016
    Location
    Italy
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: 4 Columns Comparison

    Quote Originally Posted by Special-K View Post
    Will the numbers ever occur more than once in the column they are in?
    Yes, there could be duplicate numbers in the columns A and C.

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: 4 Columns Comparison

    Try the second formula above
    Note it's an array formula

  5. #5
    Registered User
    Join Date
    02-08-2016
    Location
    Italy
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: 4 Columns Comparison

    In my case i have about 20.000 rows.
    Is this formula correct for all those rows?

    Thanks!

  6. #6
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: 4 Columns Comparison

    Just extend the ranges with the dollars in to match your rows, ie C$1:C$20000

  7. #7
    Registered User
    Join Date
    02-08-2016
    Location
    Italy
    MS-Off Ver
    Office 2013
    Posts
    4

    Re: 4 Columns Comparison

    Ok, perfect! And if i want to show the correct REF number? What do i have to do?
    Imagine that the 1° row has 233 like reference, the second row 421, the third 677 etc....

    Thanks for the suppport!

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

    Re: 4 Columns Comparison

    Try (re your original file)

    =INDEX($A$1:$A$4,MATCH(B1,IF(C1=E$1:E$4,D$1:D$4),0))

+ 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] Complex comparison of columns (help!)
    By phil.aubert in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 07-07-2014, 05:03 PM
  2. Columns comparison
    By girish1989 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-27-2013, 12:59 AM
  3. Comparison between 4 columns
    By johnmathew in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 08-09-2012, 01:59 AM
  4. [SOLVED] 3 Columns / Quote Comparison
    By Keith S. in forum Excel General
    Replies: 3
    Last Post: 05-25-2012, 01:54 AM
  5. Comparison between 1 value and 2 columns
    By cycloop in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-20-2011, 08:08 AM
  6. Automated comparison between two columns
    By Laura C in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-22-2010, 03:28 PM
  7. Comparison of data in columns
    By anushazy in forum Excel General
    Replies: 1
    Last Post: 06-23-2009, 08:14 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