How to calculate Max or Min with multiple if conditions

oxygn

New Member
Joined
May 24, 2010
Messages
25
Hi All,

I am trying to figure out how to calculate max or min with multiple if conditions.

Here is sample data:
[TABLE="width: 657"]
<colgroup><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Code[/TD]
[TD]Product[/TD]
[TD]Category[/TD]
[TD]Qty[/TD]
[TD]Min[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]1[/TD]
[TD]Z[/TD]
[TD]10[/TD]
[TD]8[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1[/TD]
[TD]Z[/TD]
[TD]9[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1[/TD]
[TD]Z[/TD]
[TD]8[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1[/TD]
[TD]Z[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]2[/TD]
[TD]D[/TD]
[TD]1
[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]2[/TD]
[TD]D[/TD]
[TD]2
[/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

The condition is get the minimum Qty where Product is 1 and Category is Z. The answer should be 8.

However if I use the formula =MIN(IF(AND(Products=1, C2:C7 = "Z"), Qty)) I get answer 1.

Can you please help.

Regards
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I tried =MIN(IF(AND(Products=1, C2:C7 = "Z", Qty <> ""), Qty)) and now the answer is 0

You were almost there. Try:

=MIN(IF(Products=1,IF(C2:C7="Z",IF(D2:D7<>"",D2:D7))))

This is an array formula. So you must confirm it with Control+Shift+Enter, not just Enter.

Hope this helps
 
Upvote 0

Forum statistics

Threads
1,223,234
Messages
6,170,891
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top