Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default MAX FUNCTION

I need retrieve the number of maximun values in my range.

For example the data like following:

20, 90, 40,80,95,100

I need the top 3 numbers are 100,95,90.

The MAX function only return the highest value.

Are there any functions available to retrieve more than one maximum?

Any information is great appreciated,

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default MAX FUNCTION

Hi,
=LARGE(A1:A12,1) returns the largest value within A1:A12
=LARGE(A1:A12,2) returns the second largest value within A1:A12
....
say the largest value is 20, the second largest value is 10 and say that 10
appears twice then LARGE( ...,3) will also return 10.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Souris" wrote:

I need retrieve the number of maximun values in my range.

For example the data like following:

20, 90, 40,80,95,100

I need the top 3 numbers are 100,95,90.

The MAX function only return the highest value.

Are there any functions available to retrieve more than one maximum?

Any information is great appreciated,

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default MAX FUNCTION

Thanks for the information,
I need write 3 times =LARGE(....), I f I need the largest 3 values.
How about I need the largest 10 values?
Are there any way to write one function to have more than one values returned?

Thanks again,

"sebastienm" wrote:

Hi,
=LARGE(A1:A12,1) returns the largest value within A1:A12
=LARGE(A1:A12,2) returns the second largest value within A1:A12
...
say the largest value is 20, the second largest value is 10 and say that 10
appears twice then LARGE( ...,3) will also return 10.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Souris" wrote:

I need retrieve the number of maximun values in my range.

For example the data like following:

20, 90, 40,80,95,100

I need the top 3 numbers are 100,95,90.

The MAX function only return the highest value.

Are there any functions available to retrieve more than one maximum?

Any information is great appreciated,

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 694
Default MAX FUNCTION

You could use something like the following. LargeK returns the array of
values from the largest to the k-th largest number within the range or array.
'----------------------------------------
Public Function LargeK(Arr As Variant, k As Long) As Variant
Dim v As Variant, i As Long
ReDim v(1 To k)

For i = 1 To k
v(i) = Application.WorksheetFunction.Large(Arr, i)
Next
LargeK = v
End Function
'----------------------------------------------------------

Regards,
Sébastien
<http://www.ondemandanalysis.com


"Souris" wrote:

Thanks for the information,
I need write 3 times =LARGE(....), I f I need the largest 3 values.
How about I need the largest 10 values?
Are there any way to write one function to have more than one values returned?

Thanks again,


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default MAX FUNCTION

Thanks millions,



"sebastienm" wrote:

You could use something like the following. LargeK returns the array of
values from the largest to the k-th largest number within the range or array.
'----------------------------------------
Public Function LargeK(Arr As Variant, k As Long) As Variant
Dim v As Variant, i As Long
ReDim v(1 To k)

For i = 1 To k
v(i) = Application.WorksheetFunction.Large(Arr, i)
Next
LargeK = v
End Function
'----------------------------------------------------------

Regards,
Sébastien
<http://www.ondemandanalysis.com


"Souris" wrote:

Thanks for the information,
I need write 3 times =LARGE(....), I f I need the largest 3 values.
How about I need the largest 10 values?
Are there any way to write one function to have more than one values returned?

Thanks again,




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default MAX FUNCTION

Souris -

Here is a short example that you can extend: To return the three largest
values, select three adjacent cells in the same row, type
=LARGE(A1:A12,{1,2,3}) and holding down the Control and Shift keys press
Enter, thus "array-entering" the function. If done correctly, the entire
entry will be surrounded by curly brackets in the formula bar.

You can extend the approach to return more values, and you can enter the
function in a column by using TRANSPOSE, e.g.,
=LARGE(C1:C20,TRANSPOSE({1,2,3}))

- Mike
www.mikemiddleton.com

"" wrote in message
...
Thanks for the information,
I need write 3 times =LARGE(....), I f I need the largest 3 values.
How about I need the largest 10 values?
Are there any way to write one function to have more than one values
returned?

Thanks again,

"sebastienm" wrote:

Hi,
=LARGE(A1:A12,1) returns the largest value within A1:A12
=LARGE(A1:A12,2) returns the second largest value within A1:A12
...
say the largest value is 20, the second largest value is 10 and say that
10
appears twice then LARGE( ...,3) will also return 10.
--
Regards,
Sébastien
<http://www.ondemandanalysis.com


"Souris" wrote:

I need retrieve the number of maximun values in my range.

For example the data like following:

20, 90, 40,80,95,100

I need the top 3 numbers are 100,95,90.

The MAX function only return the highest value.

Are there any functions available to retrieve more than one maximum?

Any information is great appreciated,



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
copy of excel file not showing formulal/function in the function b oaallam Excel Discussion (Misc queries) 4 September 6th 07 01:20 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM
User-Defined Function pre-empting Built-in Function? How to undo???? MarWun Excel Programming 1 August 6th 03 09:31 PM


All times are GMT +1. The time now is 12:18 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"