Get instant live expert help with Excel or Google Sheets

Post your problem and you'll get expert help in seconds

Your message must be at least 40 characters
Our professional experts are available now. Your privacy is guaranteed.

How to Combine the SUMIF and VLOOKUP Functions in Excel

When we need to summarize the values in a dataset based on matching instances with single criteria then we use the SUMIF function. We can also nest the VLOOKUP function inside of the SUMIF function in order to make a dynamic SUMIF function. This tutorial will step through the process.

Figure 1. Combining the SUMIF and VLOOKUP Functions

The SUMIF and VLOOKUP Functions

Suppose we have a dataset of vendors’ invoices in a table range A2:C12 where invoice numbers and amounts are listed with respect to vendors’ IDs. But we want to sum the amounts for a given “Vendor Name” as criteria. As our table range A2: C12 does not contain “Vendor Name” field, so we are unable to sum the invoices amounts using simply the SUMIF function.

Figure 2. The SUMIF Function Failing Result

Looking Up the Criteria Value

In this case, we need to look up for the criteria value (Vendor ID) associated with the given value (Vendor Name). As each vendor has a unique vendor ID, let say listed in a table range H2:I9, so we can look up for the vendor ID associated with given vendor name using the VLOOKUP function in criteria argument of the SUMIF function as follows:


In this formula, the VLOOKUP function returns the Vendor ID as criteria argument value associated with Vendor Name and resultantly the SUMIF function summarizes the invoices’ amounts matching the criteria value.

Figure 3. The Output of SUMIF and VLOOKUP Functions

Instant Connection to an Expert through our Excelchat Service



Leave a Comment


Subscribe to

Get updates on helpful Excel topics

Subscribe to
Trusted by people who work at, Inc
Facebook, Inc
Accenture PLC
Siemens AG
The Allstate Corporation
United Parcel Service
Dell Inc