• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

create a column on one sheet based on unique value in another

trident50

New Member
Hello,
I'm running Excel 2013 and I have one workbook with two sheets - sheet1 and sheet2. Sheet1 has 24 columns and 26K rows. Column "A" is titled "id" and contains
id numbers that are also, some, found in column "A" of Sheet2 - which is also titled "id".

Sheet1 has no "description" column. Sheet 2 only has 2 columns - "A" is the "id" column and "b" is the "description" column.

A B

ID Description

58749651 a bunch of text

How can I create a description column on sheet1 (it would be column "U") and populate it with the description from sheet2 only where the "id" values from column "A" match?

So, basically, I'm hoping to populate a clumn in sheet 1 (the next open column is "U") where the id number matches the id number on sheet 2, column 1.

So both sheets have id numbers in column 1.

Sheet 2 only has 2 columns - column "A" is "id" and column "B" is "description"

I want those descriptions, where the ID numbers match, to populate column "U" on sheet1.

Thanks!
Rob
 
Have a look at this and see if i understood your requirements .... sheet 1 has id numbers in column A .... sheet 2 has some id numbers and a discription eg name ... in columns F and G .... matching id numbers with only the decription are then pulled into sheet 1 in column B
 

Attachments

  • SolutionJohn.xlsx
    9 KB · Views: 5
Hi John,
I appreciate the quick response and apologize for the delayed reply - I never got a notification email :(

I think what you did was correct but I couldn't make it work…I'm uploading my workbook on the off-chance you might be able to break through my ignorance :)

Anymore help is greatly appreciated!
Thanks…
Rob
 

Attachments

  • rob.xlsx
    650 KB · Views: 4
Hello Rob,

You could use VLOOKUP in Sheet1.

Use in U2, then copy down.

=IFERROR(VLOOKUP(A2+0,Sheet2!A:B,2,0),"")
 
Hello again Haseeb, Everyone!
I've been trying this morning to use the formula Haseeb gave me and modify it to match things a little differently.

I'm now trying to match columns A & B on sheets 1 & 2 and, where they match, I want to copy over column C, from sheet 2, into column J on sheet 1.

The original formula matched column A, on both sheets, and copied over column B - when there was a match, into column U on sheet 1.

But I'm not having any luck figuring it out ;)

Anybody?

Thank you very much any help!
Rob
 
Hi ,

Your file has a lot of scrambled text ; is this correct or has your file been corrupted ?

How do you wish to match columns A and B on Sheet1 and Sheet2 ?

Do you mean that column A should be concatenated with column B , and then matched ?

Can you give an example taking any particular cell data where there is a match in the two sheets ?

Narayan
 
If this formula matches column A, on both sheets, and copied over column B - when there was a match, into column U on sheet 1.
=IFERROR(VLOOKUP(A2+0,Sheet2!A:B,2,0),"")

How would edit that formula so it would match columns A&B - on both sheets and copy over column C, from sheet2, when columns A&B matched?
 
Hey Narayan, not sure why but my previous post wasn't completed…Thanks for your looking at this - not sure about the file, I just downloaded and it works okay here.

Also - it is not the file I'm currently working with - I just posted here because the question is almost exactly the same - I'm just adding column B to the lookup and copying over column C (instead of just column A and adding column B - in my original question).
 
Hi ,

It would help if you could upload a real-life working file ; I think there is some issue with the length of text strings when used with MATCH and INDEX ; secondly , I don't see any data in column C on Sheet2.

Narayan
 
Hi ,

This is a straightforward application of INDEX + MATCH.

The formula needs to be entered as an array formula , using CTRL SHIFT ENTER.

Narayan
 

Attachments

  • sample (6).xlsx
    11.8 KB · Views: 0
Hi Narayan - that's great, thank you!

Can this formula be used if the emails in column C are in different rows than
the matching names on sheet 1?
 
Hi ,

Can you upload a sample workbook ? If the offset is fixed , then it does not matter , but if the position of the email in relation to the name is different , then how can it work ?

Narayan
 
Back
Top