简体   繁体   中英

Excel trying to two compare columns in two different worksheets and return data from third column

I have one worksheet with company name in column c and company town in column d and company id in column e.

I have a second worksheet with the same company names in column c and the company towns in column d. I am missing company ids. I need to pull in the company id number to this second worksheet.

How can I compare the two columns in the first worksheet in order to match the company name and town to bring in the company id to the second worksheet? What is the easiest way to do this in excel?

I'll nominate your worksheets. The first you named i'll call it "Sheet1", and the second one, "Sheet2". You replace these names with your actual names of the worksheets

On "Sheet2",

Select E2 and put this: =vlookup(c2,Sheet1!C:E,3,FALSE) Then you copy the formula down to your last company name (or drop it down)

"C2" is the value that you look for; Sheets1!C:E is the range where it looks up for your value ("!" this sign indicates another sheet) ; "3" is the number of column from the previous range (being "1" the company name, "2" the company town and "3" the company ID);
"FALSE" indicates exact coincidence ("true" is aproximated coincidence)

The companies are always in the same town or same companies are in different towns and with different IDs? because that changes it all

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM