Populating multiple fields from existing data

  • Thread starter Thread starter dwalsh77
  • Start date Start date
D

dwalsh77

I have 1 worksheet with 3 columns: (ID, Name, City) which holds 1000 records.
I have another worksheet with the same columns but are left blank until a
user enters a ID.
What I would like is that when the user enters a ID on the 2nd worksheet,
then it would automatically fill-in the Name and City fields based on the
information from the 1st worksheet.

Thanks.
 
Use a VLOOKUP for doing that.

Assuming the table is in Sheet 1, and the lookup formulas are in columns B &
C of Sheet 2:

The ID is entered in Column A of Sheet2 and Column B has the following
formula:

=IF(ISBLANK($A$1),"",VLOOKUP($A$1,Sheet1!$A$1:$C$1000,2,TRUE))

The formula in column C of sheet 2 would be:

=IF(ISBLANK($A$1),"",VLOOKUP($A$1,Sheet1!$A$1:$C$7,3,TRUE))

The formulas look at the value in column A and if blank return nothing,
otherwise it looks down column 1 of the table in sheet1 until it finds a
match. It returns the value in columns B & C in the table from the row with
the matching ID.

Hope this is of some help.
 

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

Back
Top