Finding MAX value with multiple conditions

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,404
Office Version
  1. 2016
Platform
  1. Windows
I need a formula that will find the highest numerical value in the range B2:B5000 but only if the following criteria is met;

The value in column C must be the same as cell A3 and the value in column B must be the same as cell A1.

Can anyone assist me please?
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
confirm with shift-control-enter

=MAX(IF($C$2:$C$5000=$A$3,IF($B$2:$B$5000=$A$1,$B$2:$B$5000)))
 
Upvote 0
Alany,

Thanks - I have tried this;

Code:
LastRow = Sheet18.Cells(Rows.Count, "A").End(xlUp).Row
Range("C3:C" & LastRow).FormulaArray = "=MAX(IF(Installations!$C$2:$C$5000=A3,IF(Installations!$A$2:$A$5000=$A$1,Installations!$B$2:$B$5000)))"

The problem is that it is not copying down and it is keeping the 'A3' part for every row if you understand what I mean.

Is there a way around it?
 
Upvote 0
I find that it is actually easier to us a =sumproduct formula to get conditional maxes than it is to use the array formula that AlanY mentioned. That said it is hard to give an example that I think will solve your problem as the max would always just be the value in cell A1 based on the above.
 
Upvote 0

Forum statistics

Threads
1,214,649
Messages
6,120,732
Members
448,987
Latest member
marion_davis

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