Link to home
Start Free TrialLog in
Avatar of elimishia
elimishiaFlag for Australia

asked on

Find the highest number in a dynamic range

I am trying to create a formula that finds the highest number in a dynamic range.  For example if I put the formula in B10 it would be = MAX($B$5:B9). If I put the formula in B18 it would be = MAX($B$5:B17).   The formula I am trying to create is = MAX($B$5 : "To the cell above the one in which I am entering the formula").  The cells in the range are a mix of blanks and numbers.

Any help would be appreciated.
Avatar of elimishia
elimishia
Flag of Australia image

ASKER

I have just realized that by just using a relative reference, the range is automatically dynamic  =SUM($B$5:B9) - unless there is a better way.  thanks
Avatar of Professor J
Professor J

one way to do this without using named ranges is  =MAX(INDIRECT("B$5:B"&COUNTA(B:B)))

but if your data has blanks then this would not be of help in that case you have to use named range like the formula below


Create a named range put the this formula and name it   "LastRow"
=LOOKUP(9.99999999999999E+307,1/(1-ISBLANK(Sheet1!$B:$B)),ROW(Sheet1!$B:$B))


Create another named range and put this formula and name it "Mydynamicrange"
=Sheet1!$B$5:INDEX(Sheet1!$B:$B,LastRow)

then your formula Max will work, and as you add more numbers in Column B, the dynamic range will take care of the new dada and you do not have to change anything inside Max formula.

=MAX(Mydynamicrange)
Thank-you. However, the formula is returning 0 (the highest number is 36) and I am getting an alert about circular references.
Because I have blanks in the column I used your suggestion of two named ranges.
Two issues,

What is the sheet name that has values in B column?

If it is not Sheet1
Then either rename sheet or change the sheet1 in the dynamic range names and put the correct sheet name.

You are getting circular reference error because you have put the max formula in column B
Do not put the = max in column B put it somewhere else let's say put it in C 1
Then  it should work
ASKER CERTIFIED SOLUTION
Avatar of Hakan Yılmaz
Hakan Yılmaz
Flag of Türkiye image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sweet!  Both formulae worked brilliant.  Exactly what I was looking for.  Thank-you.