Max IF formula

willow1985

Well-known Member
Joined
Jul 24, 2019
Messages
886
Office Version
  1. 365
Platform
  1. Windows
Hello,

I am trying to get a Max IF formula to work. At first I thought of using an index match with Max however I read online that the below formula would be a better fit:

=MAX(IF(('% Complete'!A1:A6=A1),'% Complete'!$B$1:$B$7))

I need the formula to return the Maximum percentage from the list below for each color match:

% Complete
A B
Red 50%
Blue10%
Green90%
Yellow50%
Red 100%
Red 75%
Yellow25%

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>

This is what the results should be:
A B
Red 100%
Blue10%
Green90%
Yellow50%

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>


However what I get is:

Red 100%
Blue100%
Green100%
Yellow100%

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>


Any help would be greatly appreciated

Thank you :)

Carla
 

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
Re: Need help with a Max IF formula

Did you confirm the formula with Ctrl Shift Enter, rather than just enter?
If so the formula should be wrapped in {}
 
Upvote 0
Re: Need help with a Max IF formula

Another option without the need to use Ctrl Shift Enter is
=AGGREGATE(14,6,'% Complete'!$B$1:$B$7/('% Complete'!$A$1:$A$7=A1),1)
 
Upvote 0
Re: Need help with a Max IF formula

When I confirm with Shift+Ctrl+Enter I still get the incorrect results of:

Red 100%
Blue50%
Green50%
Yellow50%

<colgroup><col width="64" span="2" style="width:48pt"> </colgroup><tbody>
</tbody>
 
Upvote 0
Re: Need help with a Max IF formula

Carla

Try this and enter the formula with CTRL+SHIFT+ENTER.

=MAX(IF(('% Complete'!$A$1:$A$7=A1),'% Complete'!$B$1:$B$7))
 
Upvote 0
Re: Need help with a Max IF formula

You need to lock the cell ranges like


Book1
ABCDEFGH
1Red50%Red100%100%
2Blue10%Blue10%10%
3Green90%Green90%90%
4Yellow50%Yellow50%50%
5Red100%
6Red75%
7Yellow25%
Sheet1
Cell Formulas
RangeFormula
H1=AGGREGATE(14,6,$B$1:$B$7/($A$1:$A$7=F1),1)
G1{=MAX(IF($A$1:$A$7=A1,$B$1:$B$7))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
Re: Need help with a Max IF formula

Try a "regular" formula:

<table border="1" cellspacing="0" style="font-family:Calibri,Arial; font-size:11pt; background-color:#ffffff; "> <colgroup><col style="font-weight:bold; width:30px; " /><col style="width:76.04px;" /><col style="width:76.04px;" /></colgroup><tr style="background-color:#cacaca; text-align:center; font-weight:bold; font-size:8pt; "><td > </td><td >A</td><td >B</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >1</td><td >Red</td><td style="text-align:right; ">100%</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >2</td><td >Blue</td><td style="text-align:right; ">10%</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >3</td><td >Green</td><td style="text-align:right; ">90%</td></tr><tr style="height:19px ;" ><td style="font-size:8pt; background-color:#cacaca; text-align:center; " >4</td><td >Yellow</td><td style="text-align:right; ">50%</td></tr></table><br /><table style="font-family:Arial; font-size:10pt; border-style: groove ;border-color:#00ff00;background-color:#fffcf9; color:#000000; "><tr><td ><b></b></td></tr><tr><td ><table border = "1" cellspacing="0" cellpadding="2" style="font-family:Arial; font-size:9pt;"><tr style="background-color:#cacaca; font-size:10pt;"><td >Cell</td><td >Formula</td></tr><tr><td >B1</td><td >=SUMPRODUCT(MAX(('% Complete'!$A$1:$A$7=A1)*('% Complete'!$B$1:$B$7)))</td></tr></table></td></tr></table>
 
Upvote 0
Re: Need help with a Max IF formula

I find all the formulas break down when I change the parameters to: '% Complete'!$A$1:$A$1000000=A1

If I want to add more colors for example to match. If there is no match I get a #NUM ! error as well, but I am assuming this is normal? Can I fix this by incorporating an IFERROR function?

Thank you for all your guys help!

Carla
 
Upvote 0
Re: Need help with a Max IF formula

You're ranges must be the same size like
=IFERROR(AGGREGATE(14,6, 'Labor Input BLANK'!$H$3:$H$1000/('Labor Input BLANK'!$F$3:$F$1000=D2),1),"")

Also do not reference the entire column, it will simply cause Xl to slow right & probably crash.
ALWAYS limit formula ranges to the used range & a LITTLE bit extra to allow for different sized data.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,698
Members
448,979
Latest member
DET4492

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