Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
s s is offline
external usenet poster
 
Posts: 36
Default Array function

Hi,
If I have an array of number, for instance grades(25,10,30,22), is there a
function that I could use to tell me which position of the array list
contains the smallest value? ie. in this case, it will return 1 as 10 is the
smallest value and its position in the array "grades" is 1.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,393
Default Array function

With your numbers entered in A1:A4, the formula =MATCH(MIN(A1:A4),A1:A4,0)
returns 2 as the min value (10) is in the second (not first) position

Likewise, =MATCH(LARGE(A1:A4,3),A1:A4,0) returns 4 since the third largest
value (here 22) is in position 4.

best wsihes
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Array function

S wrote:
Hi,
If I have an array of number, for instance grades(25,10,30,22), is there a
function that I could use to tell me which position of the array list
contains the smallest value? ie. in this case, it will return 1 as 10 is the
smallest value and its position in the array "grades" is 1.

Thanks.

Since this is in the programming group, and because you referred to 10
as being in the 1 position in the array, I'll assume that grades is a
0-based array.


positionNumber=Application.Match(Application.Min(g rades), grades, 0) - 1

Alan Beban
  #4   Report Post  
Posted to microsoft.public.excel.programming
s s is offline
external usenet poster
 
Posts: 36
Default Array function

Thanks a lot. This is exactly what I am looking for.

"Alan Beban" wrote:

S wrote:
Hi,
If I have an array of number, for instance grades(25,10,30,22), is there a
function that I could use to tell me which position of the array list
contains the smallest value? ie. in this case, it will return 1 as 10 is the
smallest value and its position in the array "grades" is 1.

Thanks.

Since this is in the programming group, and because you referred to 10
as being in the 1 position in the array, I'll assume that grades is a
0-based array.


positionNumber=Application.Match(Application.Min(g rades), grades, 0) - 1

Alan Beban

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
What function or array to use? help please :o) NBVC[_165_] Excel Worksheet Functions 0 August 17th 09 01:51 PM
OR function in array-entered IF function veggies27 Excel Worksheet Functions 8 March 11th 08 06:32 PM
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R[_2_] Excel Programming 3 November 13th 07 04:08 PM
Help for Array function [email protected] Excel Worksheet Functions 1 November 28th 06 01:21 AM
#DIV/0! in the array function Sergun Excel Worksheet Functions 1 November 25th 05 01:14 PM


All times are GMT +1. The time now is 04:41 AM.

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"