# Minimum if multiple criteria

An excel formula to minimum if multiple criteria

### Related Functions

`{=MIN(IF(rng1=criteria1,IF(rng2=criteria2,values)))}`

To get the minimum value in set of numbers based on more than one criteria (i.e. to get MIN IF), you can use and array formula based on the MIN and IF functions.

Note: This is an array formula and must be entered using Ctrl + Shift + entered

In the example, we have some pricing on items in various regions. The goal is to find the minimum price for a given color and item.

In the example shown the formula in I6 is:

`{=MIN(IF(color=G6,IF(item=H6,price)))}`

With a color of "green" and item of "t-shirt" the result is \$8.00

### How this formula works

This formula uses two nested IF functions, wrapped inside MIN to return the minimum price using two criteria. Starting with logical test of the first IF statement, color = G6, the values in the named range color (B6:B14) are checked against the value in cell G6, "green". The result is an array like this:

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

In the logical test for the second IF statement, item = H6, the values in the named range item (C6:C14) are checked against the value in cell H6, "t-shirt". The result is an array like this:

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

The "value if true" for the 2nd IF statement the named range "prices" (E6:E14), which is an array like this:

{9;8;10;9;8;7;9;10;8}

A price is returned for each item in this range only when the result of the first two arrays above is TRUE for items in corresponding positions. In the example shown the final array inside of MIN looks like this:

{9;8;10;FALSE;FALSE;FALSE;FALSE;FALSE;FALSE}

Note the only prices that "survive" are those in a position where the color is "green" and the item is "t-shirt".

The MIN function then returns the lowest price, automatically ignoring FALSE values.

### Alternative syntax using boolean logic

You can also use the following array formula, which uses only one IF function together with boolean logic:

`{=MIN(IF(((color=G6)*(item=H6))>0,price))}`