Maxif without array

ShanaVT

Board Regular
Joined
May 12, 2010
Messages
86
I am trying to create a maxif statement without using an array. When I use this formula without an array =MAX(IF(AND($A$1:$A$5=A1, $B$1:$B$5=B1),($C$1:$C$5)) it works for the range of rows 1 to 5 but since I want to be able to drag this formula down and not redo it for each section and when rows are added I changed it to =MAX(IF(AND($A:$A=A1, $B:$B$B1),($C:$C)). After the change it no longer returns the correct values. Any ideas why or how to fix it without using an array?
 

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"
Why the opposition to array formulas?

I'm not sure your posted formula actually works the way you think it does.

It should be array entered
=MAX(IF(($A$1:$A$5=A1)*($B$1:$B$5=B1),$C$1:$C$5))
 
Upvote 0
I think you have to use an array formula unless you have Excel 2016. Not sure why it worked for you for rows 1-5 without an array.
 
Upvote 0
The file is already quite large and the array significantly impacts calculation time since it will be repeated for 1000+ rows. Below is the example data set where column D reflects the desired solution. I also don't want to lock the cells for each range (A, B, C, D) - in other words I need to be able to drag the formula all the way down column D.

A115
A225
A335
A445
A555
B1610
B2710
B3810
B4910
B51010
C11115
C21215
C31315
C41415
C51515
D11620
D21720
D31820
D41920
D52020

<tbody>
</tbody>
 
Last edited:
Upvote 0
the array significantly impacts calculation time since it will be repeated for 1000+ rows.
1000+ rows of formulas already impacts calculation time, whether they are arrays or not.
What matters is the 'efficiency' of the formula.
Array DOES NOT automatically mean Not Efficient.
The same Logic/Calcluations have to occur whether it's an array or non-array formula.

Anyway, off the soapbox.


So assuming this formula does deliver the desired result for the first row
=MAX(IF(($A$1:$A$5=A1)*($B$1:$B$5=B1),$C$1:$C$5))

Can you manually adjust it for a few rows as you would like it to happen automatically as dragged down?
 
Last edited:
Upvote 0
I don't think an array formula would cause too much of a performance issue. I would imagine a column reference could potentially slow you down, have you considered using a dynamic named range?
 
Last edited:
Upvote 0
Which version of Excel are you using?
XL2010+ has the Aggregate function which should work

=AGGREGATE(14,6,($A$1:$A$5=A1)*($B$1:$B$5=B1)*$C$1:$C$5,1)
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,198
Members
449,072
Latest member
DW Draft

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