Compare columns on 2 sheets and return data from another column

I have scoured the net, and cannot seem to find anything that is close enough to my issue to solve my problem.

With that said: I have a workbook with 2 sheets; On one sheet, I have a column with numbers; on the other sheet, I have a column with numbers and a column with a code (3 digit number to classify a line item).

This is how it looks:

***SHEET 1***                                ***SHEET 2***
Column 1     Column 2                        Column 1     Column 2
789123                                       985689       000
985689                                       789123       212
123456                                       555416       260
478996                                       478996       360
555416                                       123456       448

I need a function that will compare S1, C1 to S2, C1 and once it finds a matching number, take the value to the right of S2, C2 and copy it to S1, C2. If there is no match, then return "N/A".

EX)

***SHEET 1***                                ***SHEET 2***
Column 1     Column 2                        Column 1     Column 2
789123       212                             985688       000
985689       N/A                             789123       212
123456       448                             555416       260
478996       360                             478996       360
555416       260                             123456       448

What function could I possibly use to get this result? I have played around with 'IF', 'HLOOKUP', 'VLOOKUP', and even tried a macro, but I keep coming up with nothing.

Also, please link any other forum you know of to this one to help answer if you need to. :)

Answers


Use vLookup!

In S1, C2: =VLOOKUP(<Cell from C1>, <Range of S2C1+S2C2>, 2, FALSE)


Need Your Help

Slow query time SQL/Java

java mysql sql database join

I am querying a rather large database with thousands of rows. It's taking in the neighborhood of 5 minutes, whereas it should take about 5 seconds.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.