ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Populating multiple fields from existing data (https://www.excelbanter.com/excel-discussion-misc-queries/183441-populating-multiple-fields-existing-data.html)

dwalsh77

Populating multiple fields from existing data
 
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.

Kevin B

Populating multiple fields from existing data
 
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$1 000,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.
--
Kevin Backmann


"dwalsh77" wrote:

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.



All times are GMT +1. The time now is 01:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com