Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

How to compare two columns and return values from the third column in Excel?

doc compare two lists and return for third 1

For example, I have the following two columns, column A is some projects, and column B is the corresponding names. And here, I have some random projects in column D, now, I want to return the corresponding names from column B based on the projects in column D. How could you compare the two columns A and D and return the relative values from column B in Excel?

Compare two columns and return value form third column with formulas

Compare two columns and return value form third column Kutools for Excel


Vlookup and return matching values from the third column:

Kutools for Excel collects multiple useful formulas for Excel Users, by using them you can quickly solve many difficult problems, such as calculate ages, add months, years, days, weeks, vlookup and return values from third column and so on.

doc compare two lists and return for third 9

Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!



The following formulas can help you to compare two columns and extract the corresponding values from the third column, please do as follows:

1. Enter any of the below two formulas into a blank cell besides the compared column, E2 for this instance:

=IF(ISNA(MATCH(D2,$A$2:$A$16,0)),"",VLOOKUP(D2,$A$2:$B$16,2,FALSE))

=VLOOKUP(D2,$A$2:$B$16,2,FALSE)

2. Then press Enter key to get the first corresponding value, see screenshot:

doc compare two lists and return for third 2

3. And then select the cell and drag the fill handle down to the cells that you want to apply this formula, and all the corresponding values have been returned at once. See screenshot:

doc compare two lists and return for third 3

Note: In the above formulas: D2 is the criteria cell that you want to return the value based on, A2:A16 is the column including the criteria to be compared with, A2:B16 the data range that you want to use.


Kutools for Excel’s Look for a value in list also can help you to return the corresponding data from another data range.

Kutools for Excel : with more than 300 handy Excel add-ins, free to try with no limitation in 60 days

After installing Kutools for Excel, please do as follows:

1. Click a blank cell where you want to return the relative data.

2. Then click Kutools > Formulas > Look for a value in list, see screenshot:

doc compare two lists and return for third 4

3. In the Formula Helper dialog box, do the following operations:

(1.) Click doc compare two lists and return for third 6 button beside the Table_array to select the data range that you want to look from, and enter the $ character to the cell reference to make the relative reference to absolute reference;

(2.) Click doc compare two lists and return for third 6 button beside the Look_value to select the criteria value you need;

(3.) Click doc compare two lists and return for third 6 button beside the Column to select the column will be returned the corresponding values from.

doc compare two lists and return for third 5

4. Then click Ok button to close the dialog, and the first corresponding data has been displayed, see screenshot:

doc compare two lists and return for third 7

5. Then select the first matching cell and drag the fill handle down to the cells that you want to apply this formula, and all the relative values have been returned at once, see screenshot:

doc compare two lists and return for third 8

Download and free trial Kutools for Excel Now !


Kutools for Excel: with more than 200 handy Excel add-ins, free to try with no limitation in 60 days. Download and free trial Now!


Kutools for Excel Solves Most of Your Problems, and Increases Your Productivity by 80%

  • Reuse: Quickly insert complex formulas, charts and anything that you have used before; Encrypt Cells with password; Create Mailing List and send emails...
  • Super Formula Bar (easily edit multiple lines of text and formula); Reading Layout (easily read and edit large numbers of cells); Paste to Filtered Range...
  • Merge Cells/Rows/Columns without losing Data; Split Cells Content; Combine Duplicate Rows/Columns... Prevent Duplicate Cells; Compare Ranges...
  • Select Duplicate or Unique Rows; Select Blank Rows (all cells are empty); Super Find and Fuzzy Find in Many Workbooks; Random Select...
  • Exact Copy Multiple Cells without changing formula reference; Auto Create References to Multiple Sheets; Insert Bullets, Check Boxes and more...
  • Extract Text, Add Text, Remove by Position, Remove Space; Create and Print Paging Subtotals; Convert Between Cells Content and Comments...
  • Super Filter (save and apply filter schemes to other sheets); Advanced Sort by month/week/day, frequency and more; Special Filter by bold, italic...
  • Combine Workbooks and WorkSheets; Merge Tables based on key columns; Split Data into Multiple Sheets; Batch Convert xls, xlsx and PDF...
  • More than 300 powerful features. Supports Office/Excel 2007-2019 and 365. Supports all languages. Easy deploying in your enterprise or organization. Full features 30-day free trial.
kte tab 201905

Office Tab Brings Tabbed interface to Office, and Make Your Work Much Easier

  • Enable tabbed editing and reading in Word, Excel, PowerPoint, Publisher, Access, Visio and Project.
  • Open and create multiple documents in new tabs of the same window, rather than in new windows.
  • Increases your productivity by 50%, and reduces hundreds of mouse clicks for you every day!
officetab bottom
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.
  • To post as a guest, your comment is unpublished.
    pavan · 7 months ago
    what if i have repeated valued in d column i.e with same name Q!,Q2,Q3,Q4 now if i use your formula i get only Q1 value i need also the 2nd,3rd,4th,matches also
  • To post as a guest, your comment is unpublished.
    Jason McArthur · 8 months ago
    I want to compare 2 columns data on one sheet to a range on another sheet and return the data in the 3rd column from the 2nd sheet
  • To post as a guest, your comment is unpublished.
    A · 9 months ago
    I have 3 columns, A B C, i'd like to get the value of A where the value in Column C matches the value in column B is that possible?
    • To post as a guest, your comment is unpublished.
      skyyang · 9 months ago
      Hi, .
      Could you explain your problem more detailed, or you can insert a screenshot here?
      Thank you!
      • To post as a guest, your comment is unpublished.
        Shaikh Wasim · 6 months ago
        i'm facing the same issue,can u provide any formula for this type of calculation,i want result in another column.
        • To post as a guest, your comment is unpublished.
          skyyang · 6 months ago
          Hi, guys,
          Could you give your problem more detailed, or, you can insert a screenshot here?
      • To post as a guest, your comment is unpublished.
        Sk Wasim · 6 months ago
        Can u help me plz, i'm facing the same issue?
  • To post as a guest, your comment is unpublished.
    Andrea · 1 years ago
    I am struggling with this and just get blanks returning.

    Want to say if cell Shhet1!ED1 matches a cell in column Sheet2!C:C then provide data for adjacent cell in Sheet2!A:A
  • To post as a guest, your comment is unpublished.
    Tamara Leigh · 1 years ago
    Please could you assist me, I need to do an excel formula for a petty cash spreadsheet where it looks for an account number input in Col_C which must be looked for in a list of account numbers in Col_L and if FALSE needs to return the value input in COL_F

    Exampled below
  • To post as a guest, your comment is unpublished.
    Hamid · 1 years ago
    I have 3 excel columns which have values like this,
    Col_A Col_B Col_C
    ----- ----- -----
    400 600
    500 800
    400 300
    300 200
    700 900
    800 700
    500 100
    I want the values to be copied in Column C from Column B, which are not Mache with Column A values.
    I mean just copy the values from Column B, which are not available in Column A.
    Like below
    Col_C
    -----
    600
    200
    100
    Is there any excel formula using which I can achieve this?
  • To post as a guest, your comment is unpublished.
    Hailey · 1 years ago
    I have a master list of film titles in a certain order that must stay in that order. I duplicate that list onto another spreadsheet in order to be able to manipulate it and it gets out of order because I need to group it according to what has been completed or not. On that duplicate list, I add ID numbers in the column next to the titles. After I have completed everything I need to do, I must add those ID numbers to the master list while keeping the title order on that master list. How can I match those IDs to the list without having to manually add them in the correct order?
    • To post as a guest, your comment is unpublished.
      skyyang · 1 years ago
      Hello, Hailey,

      May be the following formula may help you:

      =VLOOKUP(A2,new!$A$2:$B$13,2,FALSE)

      in the above formula, new is your duplicate sheet name, please replace it to your own.

      Please try it, hope it can help you!
  • To post as a guest, your comment is unpublished.
    Andreas · 2 years ago
    Hello Sir, and thanks for the formulas provided. Although I used the formula as should it gives me N/A, which as I can understand is because is not matching the criteria between Columns D and A as per your example. Now so you can have better understanding, in my workbook A2 is the criteria cell that you want to return the value based on, G1:G15359 is the column including the criteria to be compared with, A1:N15359 the data range that you want to use.

    The formula is: =IF(ISNA(MATCH(Sheet2!A2,Sheet3!$G$1:$G$15359,0)),"",VLOOKUP(Sheet2!A2,Sheet3!$A$1:$N$15359,7,FALSE))


    As you have noticed I am using data from two different sheets, although I don't think that this is where the real issue is, since when clicking on the NA error it indicates the Sheet2 A2 cell and the error given is: The cell currently being evaluated contains a constant. (I have checked and confirmed that the formats are set on general). Not sure if it's because the information text are emails or because in some cells there's nothing.


    Will be looking forward for your response.
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hello, Andresa,

      I tried your formula and it works well in my excel workbook. Can you give an attachment or a screenshot, so that i can understand well.

      Thank you!
  • To post as a guest, your comment is unpublished.
    Jinojith Nair · 2 years ago
    I need to do a comparison and pull put data as below -

    Sheet 1 contain Column A & B, B is blank. Sheet 2 contains Column C & D.


    The entire Column C items in Sheet 2 to be compared with first row item in Column A and if any corresponding values/data are there in Column A, then Column B to be populated with data corresponding to the row item in Column D.

    Column C will have a single word. Column D may or may not have data in it. Column A will have more text.
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hello,
      Could you give a detailed example for your problem?
      You can insert a screenshot or attachment.
      Thank you!
  • To post as a guest, your comment is unpublished.
    Ardi · 2 years ago
    I used this formula and it mostly worked but the data from the other sheet does not come on the same row to match the reference Criteria cell.


    Here's my formula. can you have a look at it and see if there's anything wrong

    =IF(ISNA(MATCH(DPU!C2,$A$2:$A$100,0)),"",VLOOKUP(DPU!C2,DPU!C2:AP100,2,FALSE))
    • To post as a guest, your comment is unpublished.
      skyyang · 2 years ago
      Hello, Ardi,
      If you want to vlookup from another worksheet, you should apply the following formula:
      =IF(ISNA(MATCH(A2,Sheet1!$A$2:$A$10,0)),"",VLOOKUP(A2,Sheet1!$A$2:$B$10,2,FALSE))

      Note: Sheet1 is the sheet contains the original data that you want to vlookup, and you should chaneg the cell references to your need.

      Please try it! Thank you!
  • To post as a guest, your comment is unpublished.
    Rahat Bappy · 2 years ago
    Great brother! My first formula is working. But 2nd formula not working. I tried many times. But i can't...
  • To post as a guest, your comment is unpublished.
    onika · 2 years ago
    wow, so great! good sharing thank you! it was so useful for me.
  • To post as a guest, your comment is unpublished.
    Kelly Okere · 2 years ago
    You just saved me months of stressful entries with this post. I'm so grateful!

    Thanks.
  • To post as a guest, your comment is unpublished.
    Dhaya · 2 years ago
    Thank you some much it was very useful. Need add info, what if we have duplicate value in Col B, how to return the value for that too.
  • To post as a guest, your comment is unpublished.
    VIJAY · 3 years ago
    GOOD KNOWLEDGE SHARING THANK YOU VERY MUCH