## SUMPRODUCT and nested IF functions

*Article last updated on December 12, 2017*

I have demonstrated in a previous post how to simplify nested IF functions, in this article I will show you how to simplify your SUMPRODUCT formulas regarding multiple criteria.

In most cases, there is no need for IF functions in SUMPRODUCT formulas, this is true in this case as well, the criteria below are complicated to build with IF functions.

0 <= value < 100 Rate: 1.01

100 <= value < 200 Rate: 1

200 <= value < 300 Rate: 1.03

300 <= value < 500 Rate: 1

500 <= value < 900 Rate: 1.05

900 <= value Rate: 1

If a value in column B is matching one of the above ranges the corresponding rate is used.

However, it can be easily simplified using the LOOKUP function. The following formula is entered in cell C14 in the image above.

A small table is easy to build, shown in column E and F. The LOOKUP function requires the values in E3:E8 to be sorted in an ascending order for it to work properly.

Instead of using one lookup value in the first argument I am using an entire cell range.

The rate is determined by the value in B3:B12.

The LOOKUP function matches the values in B3:B12 to the values in F3:F8 and returns the corresponding value from G3:G8 simultaneously.

Now we know which rates to use, it is now possible to multiply the amounts.

becomes

and returns

Lastly, the SUMPRODUCT function adds all numbers and returns a total.

and returns 413.4 in cell C14.

So what would the equivalent formula look like using IF functions?

You can use letters also with the LOOKUP function, remember to have them sorted from A to Z, the image above shows you this in F3:F8.

Column D is a column to verify the calculation, you don't need it.

### Download excel *.xlsx file

Formula for matching a date within a date range

Table of contents Match a date when a date range is entered in a single cell Match a date when […]

Identify overlapping date ranges

The formula in cell F6 returns TRUE if the date range on the same row overlaps another date range in […]

Overview This article describes how to create a random playlist of four teams total. Column A contains four teams. Each […]

Running totals within date range

Andrew asks: LOVE this example, my issue/need is, I need to add the results. So instead of States and Names, […]

Dynamic team generator in excel

Mark G asks: 1 - I see you could change the formula to have the experssion COUNTIF($C$1:C1, $E$2:$E$5)<5 changed so […]

Find empty cells and sum cells above

Is it possible to quickly select all empty cells and then sum cells above to next empty cell? Can I have […]

How to use the SUMPRODUCT function

The SUMPRODUCT function calculates the product of corresponding values and then returns the sum of each multiplication.

Katie asks: I have 57 sheets many of which are linked together by formulas, I need to get numbers from […]

The NETWORKDAYS function allows you to count weekdays or workdays between two dates. It ignores weekends and a custom date list […]

The formula in cell B17 counts rows in cell range B3:D17 when at least one cell per row contains data. […]

### Leave a Reply

### How to comment

**How to add a formula to your comment**

<code>Insert your formula here.</code>

**Convert less than and larger than signs**

Use html character entities instead of less than and larger than signs.

< becomes < and > becomes >

**How to add VBA code to your comment**

[vb 1="vbnet" language=","]

Put your VBA code here.

[/vb]

**How to add a picture to your comment:**

Upload picture to postimage.org or imgur

Use the img tag, like this: <img src="Insert pic link here">

**Contact Oscar**

You can contact me through this contact form