You may already be aware of the Large function. This function is used to return the nth largest value from a list.

To find the 1st and then 2nd, 3rd, 4th and 5th largest values in a list based on multiple criteria, we will need to use the Large function with the Sumproduct function.

The Sumproduct function is a brilliant and incredibly useful function for many situations. It is commonly used to test multiple criteria such as in this example.

The formula below demonstrates finding the 2nd largest value from a list where UK is in column B and London is in column C.

=SUMPRODUCT(LARGE((Data!$B$2:$B$6=”UK”)*(Data!$C$2:$C$6=”London”)*(Data!$E$2:$E$6),2))

Each criteria is placed in parenthesis and the multiply sign is used to ensure each criteria must be met. The plus sign could be used instead to apply OR logic between tests.

Being able to use formulas such as this to analyse data is extremely beneficial. Before we implemented this, they were using 3 PivotTables to drill down the information in sections.

]]>This required matching records from different worksheets using multiple conditions. To check if they were a duplicate, the first name, last name and company fields needed to match.

To achieve this I wrote an array formula using the IF and SUMPRODUCT functions. This can be seen below testing the data from columns A, B and C across both sheets.

{=IF(SUMPRODUCT(((Sheet1!$A$2:$A$16000)=A2)*((Sheet1!$B$2:$B$16000)=B2)*((Sheet1!$C$2:$C$16000)=C2))=1,βYesβ,ββ)}

An array formula has curly braces at the ends which are added when you press Ctrl + Shift and Enter to run the formula.

The SUMPRODUCT formula returns true if you all three conditions match. THE IF function then displays the word Yes if there is a match on a record, and nothing if there is no match.

The column than then be filtered by blank cells to return all the missing records.

Find out more about the SUMPRODUCT function.

How would you have solved this problem? Drop me a comment with other formulas that could have achieved the same result.

]]>