Search a named range

R

rhhince

I have numbers in column E8:F65500 which I named RANGE1, N8:O65500
which I named RANGE2.
Column A is numbered 1 to 65500 referencing RANGE1, Column J is
numbered as a continuation of column A 65501 to 131000 referencing
RANGE2.
Let's say I am looking for the minimum in RANGE1 and RANGE2, between
number 62500 and 75000 identified in Column A and Column J. How can I
put that in a formula?
 
L

Lars-Åke Aspelin

I have numbers in column E8:F65500 which I named RANGE1, N8:O65500
which I named RANGE2.
Column A is numbered 1 to 65500 referencing RANGE1, Column J is
numbered as a continuation of column A 65501 to 131000 referencing
RANGE2.
Let's say I am looking for the minimum in RANGE1 and RANGE2, between
number 62500 and 75000 identified in Column A and Column J. How can I
put that in a formula?


Try this formula:

=MIN(MIN(OFFSET(E1,62500-1,0,65500-62500+1,2)),MIN(OFFSET(N1,0,0,75000-65500,2)))

I have assumed that E8 and N8 are typos and should be E1 and N1.
Otherwise I can't see any natural mapping between numbers 1 to 65500
and the range E8:F65500 and the same for RANGE2.

Hope this helps / Lars-Åke
 
P

p45cal

rhhince;466498 said:
I have numbers in column E8:F65500 which I named RANGE1, N8:O65500
which I named RANGE2.
Column A is numbered 1 to 65500 referencing RANGE1, Column J is
numbered as a continuation of column A 65501 to 131000 referencing
RANGE2.
Let's say I am looking for the minimum in RANGE1 and RANGE2, between
number 62500 and 75000 identified in Column A and Column J. How can I
put that in a formula?

I know this is in the worksheet function section of codecage
nonetheless you could make your own user defined function and use i
thus on a worksheet:
=mymin((RANGE1,RANGE2),62500,75000)

however the code behind it is:Function MyMin(TheRange
myBottom, myTop)
MyMin = 1E+20
For Each rw In TheRange.Rows
numb = rw.Offset(, -4).Resize(, 1).Value
If numb <= myTop And numb >= myBottom Then
For Each Cll In rw.Cells
If MyMin > Cll.Value Then MyMin = Cll.Value
Next Cll
End If
Next rw
End Function

It's a bit more flexible:

- the ranges can be any number of columns wide, and multiple range
don't have to be the same width
- there can be any number of ranges
- doesn't require named ranges


but:

- the column of numbers must be 4 columns to the left of each range
- if there's more than one range then those ranges must be enclose
in their own parentheses (see examples)
- so far I've not provisioned for non-numeric values in the ranges
- if it doesn't find a minimum it returns 1E+20
- it's not very efficient



examples:
=mymin(E8:F45,6,30)
=mymin(*(*E8:F65500,N8:O65500*)*,62500,75000)
=mymin(*(*L26:S35,L41:Q56,L59:X62*)*,10,30)

If you wanted, we could add a parameter to allow the use of an offse
other than -4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top