Forum Discussion
MohammedHussain
Sep 21, 2023Copper Contributor
Have 1 Column Autofill After Inputting Data Into Another Column
Can anyone assist me with the following:
I have a spreadsheet which has 2 columns, column 1 has names, column 2 has vehicle registrations.
Is there anyway I could get each cell in column 2 to autofill when the same cell next to it in column 1 has the names inputted.
What I'm trying to do is have the vehicle registrations automatically fill in as soon as I input a certain persons name. Right now I'm doing it all manually and is time consuming.
- NikolinoDEGold Contributor
To automatically fill the vehicle registration in column 2 when you input a certain person's name in column 1 in Excel 365, you can use Excel's VLOOKUP function or a similar lookup function.
Here is how you can set it up:
- Create a Table: If your data is not already organized in a table, you should consider turning it into an Excel table. To do this, select your data in columns A and B, including headers, and go to the "Insert" tab, then click on "Table." This will make it easier to manage your data and apply formulas.
- Create a Reference Table: You need a reference table that links names to vehicle registrations. You can do this in a separate sheet or within the same sheet. For this example, let us assume you have a reference table in columns D and E, where column D contains names, and column E contains vehicle registrations.
- Use VLOOKUP Function: In column B (the column where you want the vehicle registrations to appear), you can use the VLOOKUP function. Assuming you're starting in cell B2, enter the following formula:
=IF(A2<>"", VLOOKUP(A2, $D$2:$E$100, 2, FALSE), "")
- A2<>"" checks if there is a name in cell A2.
- VLOOKUP(A2, $D$2:$E$100, 2, FALSE) looks up the name in A2 within the reference table (D2:E100) and returns the corresponding vehicle registration from column E.
- "" returns an empty cell if there's no name in A2.
- Copy the Formula: Copy the formula in cell B2 and paste it down the entire column B to apply the same logic to the entire list. Excel will automatically update the references for each row based on the name you input in column A.
Now, when you enter a person's name in column A, the corresponding vehicle registration should automatically appear in column B based on the reference table you created.
Just make sure to adjust the reference table range (D2:E100) to include all your data, and the formula will work accordingly. The text and steps were edited with the help of various AI’s.
My answers are voluntary and without guarantee!
Hope this will help you.
Was the answer useful? Mark them as helpful and like it!
This will help all forum participants.