Solved

Find the highest number in a dynamic range

Posted on 2015-01-24
6
56 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
Comment Utility
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 25

Expert Comment

by:ProfessorJimJam
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 25

Expert Comment

by:ProfessorJimJam
Comment Utility
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
Comment Utility
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
Comment Utility
Sweet!  Both formulae worked brilliant.  Exactly what I was looking for.  Thank-you.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

What is a Form List Box? (skip if you know this) The forms List Box is the alternative to the ActiveX list box. If you are using excel 2007, you first make sure you have a developer tab (click the Orb)->"Excel Options"->Popular->"Show Developer tab…
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now