![]() ![]() Table_array - the data range in the lookup sheets.Lookup_range - the column range in the lookup sheets where to search for the lookup value.Lookup_value - the value to search for.Lookup_sheets - a named range consisting of the lookup sheet names.VLOOKUP( lookup_value, INDIRECT("'"&INDEX( Lookup_sheets, MATCH(1, -(COUNTIF(INDIRECT("'" & Lookup_sheets & "'! lookup_range"), lookup_value)>0), 0)) & "'! table_array"), col_index_num, FALSE) This method requires a little preparation, but in the end, you will have a more compact formula to Vlookup in any number of spreadsheets.Ī generic formula to Vlookup across sheets is as follows: One more way to Vlookup between multiple sheets in Excel is to use a combination of VLOOKUP and INDIRECT functions. The next example demonstrates a bit more complicated but a lot more elegant approach. If you have more, repetitive IFERRORs become too cumbersome. This formula works great for 2 - 3 lookup sheets. Consequently, COLUMNS($A$1:C$1) evaluates to 3 forcing VLOOKUP to return a value from the 3 rd column. you've dragged the formula from B2 to C2), B$1 changes to C$1 because the column reference is relative. When entered in column B, COLUMNS($A$1:B$1) evaluates to 2 telling VLOOKUP to return a value from the 2 nd column in the table array. In the lookup_value argument, lock the column reference with the $ sign ($A2), so it remains fixed when copying the formula to other columns.Īs the result, you get a kind of dynamic formula that extracts matching values from different columns, depending on which column the formula is copied to:.(The row coordinate does not really matter, it can be just any row.) For the col_index_num argument, use the COLUMNS function that returns the number of columns in a specified array: COLUMNS($A$1:B$1).There are a couple of adjustments to be made: In situation when you need to return data from several columns, making col_index_num dynamic could save you some time. Make column index number dynamic to Vlookup multiple columns For example, here's how you can Vlookup in two different files ( Book1 and Book2) with a single formula: To Vlookup between two or more workbooks, enclose the workbook name in square brackets and put it before the sheet name. In this example, both lookup sheets have the same number of rows (A2:C6), but your worksheets may be different in size. If needed, you can specify different table arrays for different VLOOKUP functions. The idea is to nest several IFERROR functions to check multiple worksheets one by one: if the first VLOOKUP does not find a match on the first sheet, search in the next sheet, and so on. When you need to look up between more than two sheets, the easiest solution is to use VLOOKUP in combination with IFERROR. Vlookup across multiple sheets with IFERROR =VLOOKUP(A2, Jan!$A$2:$B$6, 2, FALSE)įor full details, please see VLOOKUP from another workbook in Excel. To VLOOKUP between two workbooks, include the file name in square brackets, followed by the sheet name and the exclamation point.įor example, to search for A2 value in the range A2:B6 on Jan sheet in the Sales_reports.xlsx workbook, use this formula: Excel will insert a reference with the correct syntax automatically, sparing you the trouble to check the name and troubleshoot. Instead of typing a sheet name directly in a formula, you can switch to the lookup worksheet and select the range there.For more info, please see How to reference another sheet in Excel. If the sheet name contains spaces or non-alphabetical characters, it must be enclosed in single quotation marks, like 'Jan Sales'!$A$2:$B$6.In a similar manner, you can Vlookup data from the Feb and Mar sheets: Putting the arguments together, we get this formula:ĭrag the formula down the column and you will get this result: Range_lookup is set to FALSE to look up an exact match.Please pay attention that we lock the range with absolute cell references to prevent it from changing when copying the formula to other cells.Ĭol_index_num is 2 because we want to copy a value from column B, which is the 2 nd column in the table array. To refer to it, prefix the range reference with the sheet name followed by the exclamation point: Jan!$A$2:$B$6. Table_array is the range A2:B6 on the Jan sheet.Lookup_values are in column A on the Summary sheet, and we refer to the first data cell, which is A2.For this, we define the following arguments: VLOOKUP(lookup_value, Sheet!range, col_index_num, )Īs an example, let's pull the sales figures from Jan report to Summary sheet.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |