Combining Excel SUMIF and VLOOKUP functions is one of the most popular formulas to gather values from multiple sheets and sum values based on a criterion. In this article, we are going to learn about how to do that with multiple examples and explanations. So, be prepared to go through the entire article.
Download Practice Workbook
Download the following workbook and do the exercises.
Introduction to Excel SUMIF Function
The SUMIF function sums up the values based on a particular condition.
- Syntax:
=SUMIF(range, criteria, [sum_range])
- Arguments:
range: The range of values to sum
criteria: Condition to use in the selected range
[sum_range]: Where we want to see the result.
Introduction to Excel VLOOKUP Function
VLOOKUP function looks for a value in a vertically organized table and returns the matched value.
- Syntax:
=VLOOKUP (lookup_value, table_array, column_index_num, [range_lookup])
- Arguments:
lookup_value: It is the value that we want to lookup.
table_array: From where we want to lookup.
column_index_num: The number of columns in the range containing the return value.
[range_lookup]: For exact match = FALSE, Approximate / Partial match = TRUE.
2 Easy Ways to Combine SUMIF and VLOOKUP Functions Across Multiple Sheets in Excel
1. Using SUMIF and VLOOKUP Functions Across Multiple Sheets
The SUMIF function works like the SUM function but it sums up only those values that match the given condition. So, we will use the VLOOKUP function inside the SUMIF function to input the criteria. Assuming we have two worksheets (Sheet1 and Sheet2). In Sheet1, we have all the employee’s ID No and their sales amount with the price in range B4:D9.
In Sheet2, we have all the employees’ names with their ID No.
Here we are going to search for the employee Lily (Cell C11) of Sheet1. Presently, from Sheet2, we are going to look for her ID No and show the total sum of sales prices in cell C12 (Sheet1).
Steps:
- Firstly, select cell C12 in Sheet1.
- Then, type the formula:
=SUMIF(B5:B9,VLOOKUP(C11,Sheet2!B5:C9,2,FALSE),Sheet1!D5:D9)
- After that, hit ENTER to see the result.
Formula Breakdown
- VLOOKUP(C11,Sheet2!B5:C9,2,FALSE)
After that, this will look up the ID No for the value of Cell 11 of Sheet1 from Sheet2 cell range B5:C9. Then returns the exact match.
- SUMIF(B5:B9,VLOOKUP(C11,Sheet2!B5:C9,2,FALSE),Sheet1!D5:D9)
So, this will sum up all the prices, based on the exact match of ID No from the previous step.
Notes:
- If you’re not an Excel 365 user, then to get the final result, you have to press CTRL + SHIFT + ENTER as VLOOKUP works as an array formula.
- The column index number cannot be less than 1.
- SUMIF function only works on numerical data.
Read More: SUMIF for Multiple Criteria Across Different Sheets in Excel (3 Methods)
Similar Readings
- SUMIF with Multiple Criteria (5 Easiest Examples)
- How to Pull Data From Another Sheet Based on Criteria in Excel
- SUMIF with Multiple Criteria for Different Columns in Excel
- Sum Multiple Columns Based on Multiple Criteria in Excel
2. Combining SUMIF, VLOOKUP & INDIRECT Functions Across Multiple Sheets
In this section, we are going to use SUMPRODUCT & INDIRECT functions with VLOOKUP & SUMIF functions for multiple worksheets. Here, we have three worksheets. At first, in the first worksheet ‘Bonus’, we can see the employee names. Then, we have to find out the amount of bonus for each employee. There is also a bonus criteria table (E4:F7) showing the bonus amount based on the sales amount. We need to extract values from Month 1 and Month 2 worksheets.
As a result, the sales of Month 1 are on the below worksheet.
Therefore, the sales of Month 2 are on the below worksheet.
Steps:
- Firstly, select cell C5 of the Bonus worksheet.
- Secondly, type the following formula:
=VLOOKUP(SUMPRODUCT(SUMIF(INDIRECT("'"&$H$5:$H$6&"'!"&"B5:B9"),Bonus!B5,INDIRECT("'"&$H$5:$H$6&"'!"&"C5:C9"))),$E$5:$F$7,2,TRUE)
- Finally, hit ENTER and use Fill Handle to see the rest of the result.
Formula Breakdown
- The INDIRECT function converts the text string into a valid cell reference. Here it will refer to the sheets from the cell range H5:H6.
- To include the range of sum and criteria, the SUMIF function will use reference worksheets that we indicated. Correspondingly, it will return the value sales amount of each employee from the worksheets Month 1 & Month 2.
- The SUMPRODUCT function will sum up the amounts we found from the above procedure.
- In the Bonus worksheet, the VLOOKUP function looks up from the range E5:E7. At last, it will return the matched bonus amount of an employee.
Notes:
- The column index number won’t be less than 1.
- Input the index number as a numerical value.
- SUMIF function only works on numerical data.
- We should press Ctrl+Shift+Enter as VLOOKUP works as an array formula.
Read More: Excel SUMIF Function for Multiple Criteria (3 Methods + Bonus)
Conclusion
That’s all about today’s session. So, these are some easy methods to combine SUMIF and VLOOKUP functions across multiple sheets in Excel. Please let us know in the comments section if you have any questions or suggestions. For a better understanding, please download the practice sheet. Visit our website ExcelDemy, a one-stop Excel solution provider, to find out about diverse kinds of excel methods. Thanks for your patience in reading this article.