lookup and Sum


Array fomulas comes in handy when you want to lookup and sum large amount of data. Array formulas replaces multiple normal formulas,performs multiple calculations and returns a single value as a result.

For example using  below Main sales data in Quantity and a lookup price table, Calculate total sales for customer Brosina Hoffman?

Lookup and Sum in Excel


There are 3 ways to do this;

1.Using a combination of SUM,SUMIF & IF 


How this Works;

SUMIF(LookupProducts,SalesProduct,Price) is used to fetch the price per product


IF(Customers=G4,1,0) compares the customer name in the customers list and returns an array of 1 & 0


QuantitySold  returns an array of all quantity  of sold


Since this is an array formula the SUM function sums the products of all arrays and  it iterates the process described above for each value.

2. Using a combination of  SUM, IF & TRANSPOSE


This formula works almost the same as one above the only difference being IF & TRANSPOSE  are used to fetch the Prices;

IF(SalesProducts=TRANSPOSE(LookupProducts),TRANSPOSE(Price)) is used to creates an array of prices per product.


Every thing else is the same.

NB: TRANSPOSE function is used to make the vertical lookup table to be horizontal. As a result, we can multiply the vertical array (the Main table) and the horizontal array (the lookup table) to create a 2-dimensional array formula.

3.  Using a combination of SUMLOOKUP


Again this is the same as the first formula the ONLY difference is we use LOOKUP instead of SUMIF to fetch Prices

LOOKUP(SalesProducts,LookupProducts,Price) is used to creates an array of prices per product.



  • These are array fomulas so remember to Ctrl + Shift +Enter
  • For LOOKUP to work you have to sort the data in lookup table ascendingly

Download Worksheet for Practice.

Leave a Comment:

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