Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have two sheets in my workbook.

Sheet A contains two columns as student Id, student Name Sheet B contains student id,month name and some other columns too. student id is not unique in this sheet.

Now i want to add another column of student name(from sheet a) into sheet B, is it possible that i can write some formula for sheet B that compares the student id columns in both sheets and returns the student name (from sheet A)

share|improve this question

migrated from stackoverflow.com May 18 '11 at 20:35

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers 2

You need to use a =VLOOKUP(lookup_value,table_array,col_index_num,range_lookup):

In sheet B put the following formulae (assuming your student ID is in column A-

=VLOOKUP(A1, Sheet1!A:B, 2, 0)

The first A1 value is the cell that contains the student ID on sheet B. The Range (A:B) is the look table on the first sheet. The 2 is the column from the range (A:B) you want to return. The 0 is the true or false (0=false) this basically means EXACT match.

Hope this helps.

share|improve this answer
add comment

If Sheet1 has studentId in column A and name in column B Sheet2 has studentId in column A put this is column B in Sheet 2 (assuming you have a header row):

=IF(Sheet1!A2=A2,Sheet1!B2,)

Basically prepend your cell name with the sheet name and !

share|improve this answer
    
This only works if Column A is identical on both sheets -- unlikely, and not very useful since copy/paste would work in that case. –  Excellll Jun 20 '11 at 21:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.