Min/max with criteria

syban

New Member
Hello, I am using an averageif to calculate the average of the prices that a company bought boxes of aluminium. I am using the following function and excel calculates the average price of aluminium buys only (the data is in different page and the function is on another sheet called results)
=AVERAGEIF('SHEET A'!F2:F14;"ALUMINIUM";'SHEET A'!K2:K14)

I am having problem with doing the same thing with min and max function. I want excel to find the minimum and maximum price of aluminium buys only.

I would appreciate the help because this is for my work.

Sincerely yours
Syban

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

etaf

Well-known Member
=MIN(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM")*('SHEET A'!\$K\$2:\$K\$14<>""),'SHEET A'!\$K\$2:\$K\$14))
use control shift enter to get an Array
{=MIN(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM")*('SHEET A'!\$K\$2:\$K\$14<>""),'SHEET A'!\$K\$2:\$K\$14))}

for MAX
{=MAX(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM"),'SHEET A'!\$K\$2:\$K\$14))}

syban

New Member
=MIN(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM")*('SHEET A'!\$K\$2:\$K\$14<>""),'SHEET A'!\$K\$2:\$K\$14))
use control shift enter to get an Array
{=MIN(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM")*('SHEET A'!\$K\$2:\$K\$14<>""),'SHEET A'!\$K\$2:\$K\$14))}

for MAX
{=MAX(IF(('SHEET A'!\$F\$2:\$F\$14="ALUMINIUM"),'SHEET A'!\$K\$2:\$K\$14))}

Thank you very much etaf! lifesaver...!Very helpful!!!!

syban

New Member
Oops sorry mate....I just noticed that this calculates the min and max of the entire column....not only by the ones belonging to Aluminium buys....

syban

New Member
Never mind!!!! PC problem!!!! Its ok now! sorry

etaf

Well-known Member

Replies
2
Views
152
Replies
10
Views
297
Replies
0
Views
340
Replies
2
Views
386
Replies
15
Views
311

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

1,163,951
Messages
5,834,533
Members
430,295
Latest member
amdis

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.

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

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