Comparing two columns and if they match put the contents of one column into a different one

Montana Man
Montana Man used Ask the Experts™
on
I have two spreadsheets, both have a column that displays something like this:

LloydDana1961

I need to compare both of the spreadsheets and if each column matches, i need to take a number from spreadsheet B Column K and put that content into Spreadsheet A column F.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If say the column A in sheet A is being compared to column A in sheet B than you can but following formula and drag it to all rows of column F of Sheet A

=IF(SheetA!A1=SheetB!A1,SheetB!K1,"")


I am attaching the spreadsheet here for your reference. Notice that in row 2 the columns do not match and so the value is not copied in column F.

Good Luck!
Book1.xlsx
Montana ManDigital Leader

Author

Commented:
How about if Sheet A and Sheet B don't match?  In other words i want to do a Vlookup i believe that looks at sheet A Column A which has this:

LloydDana1961

And then look thru Sheet B, Column a at lets say 5000 records to find a match, if it does then take the contents of Column K and put that in Sheet A column F.
Montana ManDigital Leader
Commented:
Here is what i did, my solution worked.  Thanks So much for all of your help!

=VLOOKUP(A2,'B'!$A:$J,10,FALSE)
Most Valuable Expert 2012
Top Expert 2012

Commented:
You might want to fix the range A:J on your B sheet to say A1:J1000 or so, if you don't know how large your data might be, but anything would be better than having vlookup go against the entire range for an exact match.

=VLOOKUP(A2,'B'!$A1:$J1000,10,FALSE)

Or, alternatively, build a dynamic range name that represents your A:J and specifies the exact range as a result, then you'll have a more efficient VLOOKUP.

However, if you're not doing much in the workbook in the way of calculations, what you have is just fine for starters, but as your workbooks/sheets grow with calcs and if things slow down, remember using entire columns adds intensity.

Cheers,

Dave
Montana ManDigital Leader

Author

Commented:
though Vlookup was the correct solution i never made it clear that i was comparing a range from one spreadsheet to a field in the other.   wasiftoor did a great job in helping me figure this out and i am sure if i would have explained myself better right away wasiftoor would have had the answer right away.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial