I have the below formula working fine over large ranges of data in Excel 2007.
In all cases Range1, Range2 and ArrayRange are the same start and end rows.
Working:
=PERCENTILE(IF(((Range1=Value)*(Range2=Value2)),ArrayRange),0.9)
When I'm updating the formula within a macro, I can't seem to figure out the correct way to formulate the above using VBA.
Can anyone assist with the below?
Not Working:
90thPercentile = Application.Percentile(((Range1 = Value) * (Range2 = Value2), ArrayRange), 0.9)
90thPercentile = Application.Percentile(If(Range1 = Value,IF(Range2 = Value2, ArrayRange))), 0.9)
many thanks Nik