Finding MAX value with multiple conditions

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,422
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

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
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,223,904
Messages
6,175,295
Members
452,633
Latest member
DougMo

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