Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with Excel Array?

Hello,

I need a bit of help with what maybe a very simple task.

I have three columns of data (A B C). I need to locate the 3 rows
containing the highest value in column C and then return the
corresponding values in Columns A and B. I would like the high values
and the corresponding values from A and B printed in an adjacent
column (E and F and G). Actually, the location of the final values is
unimportant. Any advice or help anyone could give would be MUCH
APPRECIATED!!

For example:

A B C D E F G
3 5 3
35 42 13
34 15 95
35 1 46
94 42 94
High A_Val B_Val
95 34 15
94 94 42
46 35 1


Thank you much,

Aaron

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Help with Excel Array?

The LARGE function does the job

=large(a1:A4,5) where 5 would be the 5th largestt number

" wrote:

Hello,

I need a bit of help with what maybe a very simple task.

I have three columns of data (A B C). I need to locate the 3 rows
containing the highest value in column C and then return the
corresponding values in Columns A and B. I would like the high values
and the corresponding values from A and B printed in an adjacent
column (E and F and G). Actually, the location of the final values is
unimportant. Any advice or help anyone could give would be MUCH
APPRECIATED!!

For example:

A B C D E F G
3 5 3
35 42 13
34 15 95
35 1 46
94 42 94
High A_Val B_Val
95 34 15
94 94 42
46 35 1


Thank you much,

Aaron


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 812
Default Help with Excel Array?

If the values to rank were leftmost, it could have been easy w/o VBA
using the LARGE and VLOOKUP functions. Regardless, this will work.

Sub RankUm()
Dim c As Range
Dim rng As Range
Dim ws As Worksheet

Set ws = Sheets("Sheet1")
Set rng = ws.Range("C1:C5")
ws.Range("E1") = "High"
ws.Range("F1") = "A_Val"
ws.Range("G1") = "B_Val"
For iCt = 2 To 4
ws.Range("E" & iCt) = Application.Large(rng, iCt)
For Each c In rng
If ws.Range("E" & iCt) = c Then
ws.Range("F" & iCt) = c.Offset(0, -2)
ws.Range("G" & iCt) = c.Offset(0, -1)
Exit For
End If
Next c
Next iCt
End Sub

Hth,
Merjet


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Help with Excel Array?

On Mar 7, 9:36 pm, Joel wrote:
The LARGE function does the job

=large(a1:A4,5) where 5 would be the 5th largestt number

" wrote:
Hello,


I need a bit of help with what maybe a very simple task.


I have three columns of data (A B C). I need to locate the 3 rows
containing the highest value in column C and then return the
corresponding values in Columns A and B. I would like the high values
and the corresponding values from A and B printed in an adjacent
column (E and F and G). Actually, the location of the final values is
unimportant. Any advice or help anyone could give would be MUCH
APPRECIATED!!


For example:


A B C D E F G
3 5 3
35 42 13
34 15 95
35 1 46
94 42 94
High A_Val B_Val
95 34 15
94 94 42
46 35 1


Thank you much,


Aaron


Sorry, I forgot to specify that the values in Column C are the only
values for which the 'high' value is relevant. In the real application
of this search the values in Columns A and B will be text and the
values in C will be the only numeric values for which the selection
can be based upon.

Thank you so much for your response.

Aaron

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
meaning of : IF(Switch; Average(array A, array B); array A) DXAT Excel Worksheet Functions 1 October 24th 06 06:11 PM
SEARCH EXCEL ARRAY FOR NON-VOIDS AND ENTER INTO ANOTHER ARRAY, ROSE THE RED Excel Programming 1 December 31st 04 06:01 PM
How do I resize a named array in Excel from a MxN array to a mxn . CymonM Excel Programming 8 September 27th 04 08:29 AM
Dump 5D VBA array to 2D excel array ExcelMonkey[_63_] Excel Programming 4 February 3rd 04 06:56 PM
Loading Excel Array from VB Array Faster ExcelMonkey[_3_] Excel Programming 3 January 22nd 04 02:49 AM


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