Solved

Find the highest number in a dynamic range

Posted on 2015-01-24
6
66 Views
Last Modified: 2015-01-25
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.
0
Comment
Question by:elimishia
  • 3
  • 2
6 Comments
 

Author Comment

by:elimishia
ID: 40568836
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
0
 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40568940
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)
0
 

Author Comment

by:elimishia
ID: 40569038
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.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 26

Expert Comment

by:ProfessorJimJam
ID: 40569043
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
0
 
LVL 5

Accepted Solution

by:
Hakan Yılmaz earned 500 total points
ID: 40569259
You can use OFFSET function.
=MAX(OFFSET($B$5,0,0,ROW()-ROW($B$5),1)).

Or only using INDIRECT function.
=MAX(INDIRECT("R[-1]C:R5C";FALSE))
0
 

Author Closing Comment

by:elimishia
ID: 40569828
Sweet!  Both formulae worked brilliant.  Exactly what I was looking for.  Thank-you.
0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question