Users of UW-Madison's institutional Tableau workbooks may need to pull data from one Microsoft Excel spreadsheet into another spreadsheet. This KB article explains how, by using an Excel formula called vLookup.How does the vLookup formula work?
Choose both columns you need to merge: Click B1 press Shift + ArrrowRight for choosing C1 then hit Ctrl + Shift + ArrowDown for choosing entire data cells with data in two columns. And copy data to clipboard open Notepad insert data from the clipboard to the Notepad. If both sets of numeric data are already formatted in a similar way, such as prices always formatted as $1.00, you can use the Excel consolidate feature (under the ‘Data’ dropdown menu). Open each sheet you plan to use and confirm that the data types you want to consolidate in Excel match. In a new empty worksheet, select ‘Consolidate.’.
- Locate where you want the data to go. Click that cell only once.
- At the top, go to the Formulas tab and click Lookup & Reference.
- Select vLookup
- Excel’s vLookup wizard will pop up. We’ll walk through each part of the formula.
Find the Unique Identifier (lookup value). It is usually in the same row as the empty cell you selected.
Click once on the Unique Identifier so that the cell position will automatically fill in. In this example it is cell B2.
- Go to the next field, Table_array (click in it once). In Spreadsheet 2 highlight the table containing the info you want, starting with the Unique ID.
In this example, Excel looks up Campus ID 555123123 in the first highlighted column of Spreadsheet 2.
Note: Make sure each Unique ID is listed only once in the table_array (on the second spreadsheet) so that vLookup retrieves the correct value. For example, if 555123123 is duplicated in the table_array, where Student [email protected] is the email in one row and Student [email protected] in the other, Excel will choose one of the emails for you.
- Go to Col_index_num (click in it once). This identifies which column contains the information you want from Spreadsheet 2.
Type the number of columns your field is from the Unique ID, where the Unique ID is 1. Here, the Email field is the third column.
- Go to Range_lookup (click in it once). Type FALSE to search for exact matches. The result will look something like this:
- Finally, copy and paste the formula to pull emails for the rest of the column.
(Note: if your table array is in the same Excel workbook, put $ signs around the cell values, similar to the example below. This ensures that you reference the correct cells in the table array, meaning that the table array does not shift down when you paste the formula down. See Advanced Tip below for more details.)
- The Merge Cells tool works with all Excel versions from 2003 to 2016 and can combine all data types including text strings, numbers, dates and special symbols. Its two key advantages are simplicity and speed - any concatenation is done in a couple of clicks.
- And I want to combine the rows based on Common ID. As you can see that rows 2 and 6 they both pertain to common ID 324. But the info for that ID on row 2 has filled in from columns C3:E3 and then row 3 has info for that ID on columns F4:H4. I want o combine these two rows data.
- Type the beginning of the formula: =VLOOKUP(
The formula guide will appear below.
(Note: You may notice Excel displays the formula in 2 places: the formula bar above and directly in the cell. You can edit the formula in either place.)
- Follow the guide and enter each value. Remember to insert a comma between each value.
- Insert a closed parenthesis ) and hit Enter. The end result will look like something like this:
- Finally, copy and paste the formula to pull emails for the rest of the column. Keep relative references in mind and use $ signs where necessary. (See Advanced Tip below for more details.)
- To lock in the lookup value in cell B1, insert $ signs before the column and the row:
- To lock in the column only, insert a $ before B only.
- To lock in the row only, insert a $ before 1 only.
Need More Information or Help?
Can I Merge Data From Two Columns In ExcelIf you have questions about this Tableau document, please contact Melissa Chan, Office of Data Management and Analytics Services (ODMAS) at [email protected]
Merge Data From Two Columns In Excel.
|Keywords:||Tableau Workbook Dashboard Excel 2 Two Combine Pull Data IDESuggest keywords||Doc ID:||90851|
|Owner:||Steven T.||Group:||Office of Data Management & Analytics Services KB|
|Created:||2019-04-04 11:15 CDT||Updated:||2020-06-20 04:08 CDT|
|Sites:||Office of Data Management & Analytics Services KB|
|Feedback:||243CommentSuggest a new document|