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

In vba code, I need to go through several rows (with 75 cols each) and pick
out the top 6 values PER ROW.

Are there any vba methods that would help me do this?

First, I thought I would sort and then pull of the first 6 cells. Can you
sort by Row? If not, should I transform the rows into cols and then sort
the cols?

Next, I have tried to find a Percentile / Rank or a Top N type function.

Any suggestions?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 120
Default Statistics Problem

I am not totally sure of what you need, but you might take a look into what
a pivot table could do for your data.


"Alex Lifeson" wrote in message
2...
In vba code, I need to go through several rows (with 75 cols each) and
pick
out the top 6 values PER ROW.

Are there any vba methods that would help me do this?

First, I thought I would sort and then pull of the first 6 cells. Can you
sort by Row? If not, should I transform the rows into cols and then sort
the cols?

Next, I have tried to find a Percentile / Rank or a Top N type function.

Any suggestions?

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default Statistics Problem

If you haven't given up on worksheet functions, you could use
=LARGE(range,1) through =LARGE(range,6), where range is the address of the
row of data. Maybe insert a sheet, and in cell A1 of the second sheet, enter
a formula like =LARGE(Sheet1!$A1:$BW1,COLUMN()). Fill it across to F1 and
down as many rows as needed.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Alex Lifeson" wrote in message
2...
In vba code, I need to go through several rows (with 75 cols each) and
pick
out the top 6 values PER ROW.

Are there any vba methods that would help me do this?

First, I thought I would sort and then pull of the first 6 cells. Can you
sort by Row? If not, should I transform the rows into cols and then sort
the cols?

Next, I have tried to find a Percentile / Rank or a Top N type function.

Any suggestions?

Thanks in advance!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Statistics Problem

Sub AAVV()
For Each cell In Range(Cells(2, 1), Cells(2, 1).End(xlDown))
cell.EntireRow.Sort _
Key1:=cell, _
Order1:=xlDescending, _
Header:=xlNo, _
OrderCustom:=1, _
MatchCase:=False, _
Orientation:=xlLeftToRight
Next
End Sub

--
Regards,
Tom Ogilvy


"Alex Lifeson" wrote in message
2...
In vba code, I need to go through several rows (with 75 cols each) and
pick
out the top 6 values PER ROW.

Are there any vba methods that would help me do this?

First, I thought I would sort and then pull of the first 6 cells. Can you
sort by Row? If not, should I transform the rows into cols and then sort
the cols?

Next, I have tried to find a Percentile / Rank or a Top N type function.

Any suggestions?

Thanks in advance!



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Statistics Problem

there are built in worksheet functions

rank
percentile
quartile
percentrank
max
min
large
small

see Excel help for details

--
Regards,
Tom Ogilvy

"Alex Lifeson" wrote in message
2...
In vba code, I need to go through several rows (with 75 cols each) and
pick
out the top 6 values PER ROW.

Are there any vba methods that would help me do this?

First, I thought I would sort and then pull of the first 6 cells. Can you
sort by Row? If not, should I transform the rows into cols and then sort
the cols?

Next, I have tried to find a Percentile / Rank or a Top N type function.

Any suggestions?

Thanks in advance!



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
Statistics Kshaver New Users to Excel 1 August 4th 09 06:04 PM
Statistics problem Brian Mc in StL Excel Worksheet Functions 7 June 22nd 08 08:52 PM
Statistics Mike H. Excel Discussion (Misc queries) 4 October 25th 07 12:28 PM
Statistics bebec20 Excel Discussion (Misc queries) 2 January 18th 07 05:46 PM
statistics problem driller New Users to Excel 1 November 18th 06 04:55 PM


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