Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Find the highest number in a dynamic range

Posted on 2015-01-24
6
Medium Priority
?
84 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 27

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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 27

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 2000 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

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…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial will demonstrate in Google Sheets how to use the HYPERLINK function to create live links inside your spreadsheet.

783 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