Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Reference to the N-largest value in an array

Hello

I need a formula that can give me the the array-reference of the N-
largest value in the array.

Something like:
referenceToLarge(A1:B5, 2) that gives me "A3", if A3 holds the second
largest value in the range A1:B5.



Thanks

Michael

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Reference to the N-largest value in an array

Try this *array* formula:

=ADDRESS(MAX((A1:B5=LARGE(A1:B5,2))*ROW(A1:B5)),MA X((A1:B5=LARGE(A1:B5,2))*C
OLUMN(A1:B5)),4)

--
Array formulas must be entered with CSE, <Ctrl <Shift <Enter, instead of
the regular <Enter, which will *automatically* enclose the formula in curly
brackets, which *cannot* be done manually.
You *must also* use CSE when revising the formula.

This returns a relative reference.

The last comma and 4 ( ,4 ) can be eliminated if you want an absolute
reference:

=ADDRESS(MAX((A1:B5=LARGE(A1:B5,2))*ROW(A1:B5)),MA X((A1:B5=LARGE(A1:B5,2))*C
OLUMN(A1:B5)))

--
HTH,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------
wrote in message
oups.com...
Hello

I need a formula that can give me the the array-reference of the N-
largest value in the array.

Something like:
referenceToLarge(A1:B5, 2) that gives me "A3", if A3 holds the second
largest value in the range A1:B5.



Thanks

Michael


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Reference to the N-largest value in an array

Thanks. This works.

I am now trying to further develop this formula, i.e. use the value
that I get in a condition.
For this, I need to extract the row of the reference
=ROW(your formula)

But this seems impossible, probably because I put an array formula
where a scalar value belongs.

I tried both CSR, and normal entry, but to no avail. i get an error.

Is there a workaround?

Thanks again

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,572
Default Reference to the N-largest value in an array

You say you *only* want the row number, not the entire address?

You should have asked for what you exactly want at the outset.

This much shorter *array* formula will return the row number:

=MAX((A1:B5=LARGE(A1:B5,2))*ROW(A1:B5))

Don't forget the CSE entry!
--

HTH,

RD
================================================== ===
Please keep all correspondence within the Group, so all may benefit!
================================================== ===

wrote in message
ups.com...
Thanks. This works.

I am now trying to further develop this formula, i.e. use the value
that I get in a condition.
For this, I need to extract the row of the reference
=ROW(your formula)

But this seems impossible, probably because I put an array formula
where a scalar value belongs.

I tried both CSR, and normal entry, but to no avail. i get an error.

Is there a workaround?

Thanks again


  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3
Default Reference to the N-largest value in an array

On Aug 30, 4:53 pm, "RagDyeR" wrote:
You say you *only* want the row number, not the entire address?

Thank you very much!


You say you *only* want the row number, not the entire address?


I found out that I needed both. but in hindsight It would suffice
asking
about the former.

You should have asked for what you exactly want at the outset.


May be so. I think I learned much more by trying to generalize the
question, which I am trying to
keep as a policy when addressing news groups. This is also meant so
the forum -
as a source of information for others - benefits.

I regret if it, this time, caused unnecessary work. It mostly does
not.

Thanks again

Michael

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Use one array as a reference for another cqmman Excel Discussion (Misc queries) 0 December 9th 06 08:44 PM
How to find the largest product of an array of values? ryesworld Excel Worksheet Functions 3 December 2nd 05 06:09 PM
Array Reference anar_baku Excel Worksheet Functions 3 November 29th 05 07:18 PM
average of kth largest numbers in an array of n numbers georgeb Excel Worksheet Functions 6 September 5th 05 05:57 AM
Array formula reference JAK Excel Discussion (Misc queries) 3 February 22nd 05 03:38 AM


All times are GMT +1. The time now is 01:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"