Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / December 2007

Tip: Looking for answers? Try searching our database.

Array function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
S - 10 Dec 2007 21:27 GMT
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.
Bernard Liengme - 10 Dec 2007 21:37 GMT
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
Signature

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

Alan Beban - 10 Dec 2007 22:30 GMT
> Hi,
> If I have an array of number, for instance grades(25,10,30,22), is there a
[quoted text clipped - 3 lines]
>
> 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(grades), grades, 0) - 1

Alan Beban
S - 11 Dec 2007 01:13 GMT
Thanks a lot. This is exactly what I am looking for.

> > Hi,
> > If I have an array of number, for instance grades(25,10,30,22), is there a
[quoted text clipped - 10 lines]
>
> Alan Beban
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.