1
votes

I have 2 sheets, let's say column A is item ID, column B is owner of the item. In the first sheet the column B is empty, so I need to copy column B from another sheet. I don't know if they are both ordered the same, probably yes, they appear they might be. I used IF function, IF cell-ID in the first sheet is equal to cell-ID in the second sheet and the cell-owner in the second sheet is not empty then cell-owner in the first sheet is equal to the one in the second sheet. How would I make sure that this function would work even if the order of data was different?

EDIT: I just thought of one solution to order both sheets according to ID and then use IF function, but how else could I solve this?

2
This looks like a job for VLOOKUP. - Ulli Schmid

2 Answers

1
votes

Use VLOOKUP:

=VLOOKUP(A2, Sheet2!A2:B4, 2)

Assumptions:

  • Enter this formula into the owner column B of the first sheet
  • A2 is an itemID from the first sheet
  • Sheet2!A2:B4 contains both the itemID and owner from the second sheet
0
votes

You are looking for VLOOKUP

One tutorial for how to use it here

It matches the ID number and gives you the specified column value

for example you might want something like:

=VLOOKUP(Sheet1!cellID, Rng, 2)

This matches the ID and gives you the 2nd column entry corresponding to that ID from the other Sheet. Rng is the table where you have your data, for example A1:B500. Hope this helps!