fabbius
fabbius

Reputation: 13

MAX function in Excel: is it possible to provide the range by means of variables?

I'm trying to write an excel formula to perform the MAX of a range. The default formula accepts references as the boundaries of the range of arguments:

=MAX(A1:A10)

I want to provide the boundaries of the range as variables, by inputting them in dedicated cells, something like:

=MAX(A"number of row taken from the content of cell B2":B"number of row taken from the content of cell B3)

See the attached screenshot.

Is this format supported by Excel? If yes, what's the correct syntax? Thank you!

enter image description here

Upvotes: 0

Views: 436

Answers (2)

bosco_yip
bosco_yip

Reputation: 3802

Or, this one :

=MAX(INDIRECT(("A"&B2&":A"&B3)))

enter image description here

Upvotes: 0

JvdV
JvdV

Reputation: 75840

Maybe something like:

=MAX(INDEX(A:A,B2):INDEX(A:A,B3))

Cool to know, it doesn't matter if you reference B3 or B2 first. The formula will re-arange the referencing to a valid range.

Upvotes: 2

Related Questions