Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conditional statement to match/import data in Excel sheets.

Status
Not open for further replies.

wlfpackr

IS-IT--Management
May 3, 2003
161
0
0
US
I'm having all kind of issues with this one.

I have two sheets in Excel. One has a person's name and a dept number. The other has dept number and a dept name. Crude example is below:

Code:
         [i]Sheet1[/i]
[b]Column A[/b]         [b]Column B[/b]
Bill             10001
Joe              10002
Bob              10003
Gary             10004

          [i]Sheet 2[/i]
[b]Column A[/b]         [b]Column B[/b]
10001            Accounting
10002            Corporate
10003            IT
10004            Engineering

What I want in Sheet 1 is a Column C that says if the value in Sheet1!Column B = a value in Sheet2!Column A Then put in the corresponding value from Sheet2!Column B into Sheet1!Column C.

I have no idea why this is giving me trouble, but I'm ready to admit failure to complete strangers. I'm in Office 2007 if it matters.




=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
Geez, nevermind. As soon as I posted this I saw what I was doing wrong. For those that come along later.....

Column C in Sheet 1 should equal:

=VLOOKUP(B2,'Sheet 2'!A:B,2)

=================
There are 10 kinds of people in this world, those that understand binary and those that do not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top