Forum Discussion
How do I automatically fill columns based on cell value from another excel file?
Hi - You have to use a Vlookup formula. An example is on the attached file.
The workbook assumes that the "File 1" sheet is your 1st file and the "File 2 - Code Book" sheet is your 2nd file. You would have to put the formula in Column b of your first file (the file with the duplicate values). Your lookup range will be on your second file (the file with the unique names and code book). Please let me know if this helps.
Here's the formula used in the file: =VLOOKUP($A2,'File 2 - Code Book'!$A$1:$B$7,2,FALSE)
Is there a way to expand this code to multiple columns? For example, in the code book from your example there would be multiple code columns, say Code1, Code2, etc.. Then those would fill the multiple columns on the File 1. So there would be multiple Import Code columns on File 1.