Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Selecting next to highest number in an array?

I have a array variable defined and I want to be able to pull out the
1st, 2nd, 3rd highest number out of all the available numbers.

For example
Mydata(1) = 3
Mydata(2) = 1
Mydata(3) = 4
Mydata(4) = 5

Is there a way to get the highest number out of the array? The 2nd
highest number?

I know I can do a little subroutine, but I'm hoping there's a more
direct way to get the relative numbers.

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Selecting next to highest number in an array?

Transfer the array into a worksheet column and then sort the column descending.
--
Gary's Student


" wrote:

I have a array variable defined and I want to be able to pull out the
1st, 2nd, 3rd highest number out of all the available numbers.

For example
Mydata(1) = 3
Mydata(2) = 1
Mydata(3) = 4
Mydata(4) = 5

Is there a way to get the highest number out of the array? The 2nd
highest number?

I know I can do a little subroutine, but I'm hoping there's a more
direct way to get the relative numbers.

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Selecting next to highest number in an array?

Sub ABC()
Dim mydata(1 To 4)
mydata(1) = 3
mydata(2) = 1
mydata(3) = 4
mydata(4) = 5

MsgBox Application.Large(mydata, 1)
Msgbox Application.Large(mydata,2)
' etc
End Sub

--
Regards,
Tom Ogilvy


wrote in message
oups.com...
I have a array variable defined and I want to be able to pull out the
1st, 2nd, 3rd highest number out of all the available numbers.

For example
Mydata(1) = 3
Mydata(2) = 1
Mydata(3) = 4
Mydata(4) = 5

Is there a way to get the highest number out of the array? The 2nd
highest number?

I know I can do a little subroutine, but I'm hoping there's a more
direct way to get the relative numbers.

Thanks.



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
Vlookup selecting next highest value instead of equal or nearest l Jack Excel Worksheet Functions 3 May 26th 08 05:11 PM
2 rows, highest No in row 1, then highest number in row 2 relating to that column, possible duplicates John Excel Worksheet Functions 3 August 11th 06 04:34 AM
looking up figures in a column and selecting next highest match [email protected] Excel Worksheet Functions 3 October 4th 05 01:21 AM
Selecting the 2nd highest value in a row. Tony Excel Worksheet Functions 2 July 27th 05 04:59 PM
Locating lowest/highest cell value in an array Paul Rampenthal Excel Programming 4 April 16th 04 04:28 PM


All times are GMT +1. The time now is 06:08 PM.

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

About Us

"It's about Microsoft Excel"