Skip to content
Free Excel Tutorials
  • Home
  • Excel For Beginners
  • Excel Intermediate
  • Advanced Excel For Experts

Data Analysis

  • Conditional Formatting Icon Sets Examples in Excel
  • How To Create Frequency Distribution in Excel
  • How to Create Thermometer Chart in Excel
  • What-If Analysis: Scenarios and Goal Seek in Excel
  • How to Create Gantt Chart in Excel

References

  • Perform case-sensitive Lookup in Excel
  • How to calculate two-way lookup VLOOKUP in Excel Table
  • How to use Excel TRANSPOSE Function
  • How to use Excel VLOOKUP Function
  • How to get first row number in range in Excel

Data Validations

  • Excel Data validation specific characters only
  • Excel Data validation whole percentage only
  • Excel Data validation unique values only
  • Excel Data validation with conditional list
  • Excel Data validation must not contain

Exact match lookup with SUMPRODUCT in Excel

by

This tutorial shows how to calculate Exact match lookup with SUMPRODUCT in Excel using the example below;

Formula

=SUMPRODUCT(--(EXACT(val,lookup_col)),result_col)

Explanation

Case sensitive lookups in Excel

By default, standard lookups in Excel are not case-sensitive. Both VLOOKUP and INDEX/MATCH will simply return the first match, ignoring case.

A direct way to workaround this limitation, is to use an array formula based on INDEX/MATCH with EXACT. However, if you’re looking up numeric values only, SUMPRODUCT + EXACT also gives an interesting and flexible way to do a case-sensitive lookup.

Worked Example:   Weighted average in Excel

In the example, we are using the following formula

=SUMPRODUCT(--(EXACT(E3,B3:B8)),C3:C8)

Although this formula is an array formula, it does not need to be entered with Control + Shift + Enter, since SUMPRODUCT handles arrays natively.

How the formula works

SUMPRODUCT is designed to work with arrays, which it multiplies, then sums.

In this case, we are two arrays with SUMPRODUCT: B3:B8 and C3:C8. The trick is to run a test on the values in column B, then convert the resulting TRUE/FALSE values to 1’s and 0’s. We run the test with EXACT like so:

EXACT(E3,B3:B8)

Which produces this array:

Worked Example:   Multi-criteria lookup and transpose in Excel

{FALSE;FALSE;TRUE;FALSE;FALSE;FALSE}

Note that the true value in position 3 is our match. Then we use the double negative (i.e. –, which is technically a “double unary”) to coerce these TRUE / FALSE values into 1 and 0. The result is this array:

{0;0;1;0;0;0}

At this point in the calculation, the SUMPRODUCT formula looks like this:

=SUMPRODUCT({0;0;1;0;0;0},{875;750;775;675;800;825})

SUMPRODUCT then simply multiples the items in each array together to produce a final array:

{0;0;775;0;0;0}

Which SUMPRODUCT then sums, and returns 775.

So, the gist of this formula is that the FALSE values are used to cancel out all other values. The only values that survive are those that were TRUE.

Worked Example:   Sum by weekday in Excel

Note that because we are using SUMPRODUCT, this formula comes with a unique twist: if there are multiple matches, SUMPRODUCT will return the sum of those matches. This may or may not be what you want, so take care if you do expect multiple matches!

Remember, this formula only works for numeric values, because SUMPRODUCT does’t handle text. If you want to retrieve text, use  INDEX/MATCH + EXACT.

Post navigation

Previous Post:

Weighted average in Excel

Next Post:

Win loss points calculation in Excel

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Learn Basic Excel

Ribbon
Workbook
Worksheets
Format Cells
Find & Select
Sort & Filter
Templates
Print
Share
Protect
Keyboard Shortcuts

Categories

  • Charts
  • Data Analysis
  • Data Validation
  • Excel Functions
    • Cube Functions
    • Database Functions
    • Date and Time Functions
    • Engineering Functions
    • Financial Functions
    • Information Functions
    • Logical Functions
    • Lookup and Reference Functions
    • Math and Trig Functions
    • Statistical Functions
    • Text Functions
    • Web Functions
  • Excel VBA
  • Excel Video Tutorials
  • Formatting
  • Grouping
  • Others

Logical Functions

  • IF function: Description, Usage, Syntax, Examples and Explanation
  • How to use IFS function in Excel
  • How to use Excel TRUE Function
  • How to use Excel XOR Function
  • OR function Examples in Excel

Date Time

  • How to calculate future date say 6 months ahead in Excel
  • DAYS360 function: Description, Usage, Syntax, Examples and Explanation
  • How to join date and text together in Excel
  • Basic timesheet formula with breaks in Excel
  • Calculate series of dates by workdays in Excel

Grouping

  • Running count group by n size in Excel
  • How to randomly assign people to groups in Excel
  • Group numbers with VLOOKUP in Excel
  • Calculate conditional mode with criteria in Excel
  • Group times into unequal buckets in Excel

General

  • How to count total columns in range in Excel
  • How to calculate profit margin percentage in Excel
  • How to set or clear a print area in Excel Worksheet
  • Excel Autofill Cell Ranges, Copy, Paste
  • Create dynamic workbook reference to another workbook in Excel
© 2023 xlsoffice . All Right Reserved. | Teal Smiles | Abbreviations And Their Meaning