wouter de jong
wouter de jong

Reputation: 597

How to display the value which is found in vlookup

I got an Excel like this:

---------
| 1 | a |
---------
| 2 | b |
---------
| 3 | c |
---------
| 4 | d |
---------
| 5 | e | 
---------

and a table like this:

---------
| 4 | d |
---------
| 3 | k |
---------
| 2 | b |
---------
| 1 | a |
---------

Now I want to check: If the data of the first column is the same in both tables, then if the second column is not the same, it has to display the value of the other table. So like this:

---------------------
| 1 | a | correct   |
---------------------
| 2 | b | correct   |
---------------------
| 3 | c | k         |
---------------------
| 4 | d | correct   |
---------------------
| 5 | e | not found |
---------------------

This is what I already have: =IFERROR(IF(VLOOKUP(F2;A:B;2;FALSE)=G2;"Correct";"Wrong");"Not Found") The "wrong" needs to change in some sort of formula.

Thanks in advance!

Upvotes: 1

Views: 187

Answers (2)

nightcrawler23
nightcrawler23

Reputation: 2066

You already have it in your formula. the below part gives you the value in the 2nd table corresponding to the number. this you are checking if it matches with the value in the first table. if it does not match, print this else print correct

VLOOKUP(F3,$F$8:$G$11,2,FALSE)

The formula should be

=IFERROR(IF(VLOOKUP(F3,$F$8:$G$11,2,FALSE)=G3,"Correct",VLOOKUP(F3,$F$8:$G$11,2,FALSE)),"Not Found")

Google Sheet

Upvotes: 2

Moacir
Moacir

Reputation: 627

Replace "Wrong" with VLOOKUP(F2;A:B;2;FALSE)

Upvotes: 0

Related Questions