If cell in a Col of doc1is = to cell in a Col in doc2, copy cell .

D

DDC

If cell A1 in first document is equal to cell A1 in 2nd document, I want to
copy amount next to cell A1 of 2nd document onto cell B1 of 1st document. I
tried vlookup. It worked only on the first cell, but when I copied the
formula, it didn't work. For ex:
1st document 2nd document
Col A Col B Col A Col B
610001 610001 2,665
610021 610023 3,000
610023 610024

In excel 2000
 
M

Max

...tried vlookup. It worked only on the first cell, but when I copied the
formula, it didn't work.

One guess is that it's because you didn't fix
(use "$" signs to make it absolute))
for the table array in the VLOOKUP
Example : "Sheet2!$A$1:$B$3"

Assuming your 2nd document
is in Sheet2, cols A and B
(data in range A1:B3, say)

In Sheet1 (1st document),
with col A containing the look-up values in A2 down
you could try in col B something like:

In B2: =VLOOKUP($A2,Sheet2!$A$1:$B$3,2,0)
B2 copied down

(table array uses *fixed* col references "Sheet2!$A$1:$B$3")

or

In B2: =VLOOKUP($A2,Sheet2!$A:$B,2,0)
B2 copied down

(table_array uses entire col references "Sheet2!$A:$B")

Albeit its not necessary if just for copying down purposes,
it's better to have the "$" signs affixed even for entire col references
(Avoids errors should formulas be copied across in other situations)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top