Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Need to sort a row of data and automatically copy in to another ro

I have a row of 6 random ordered numbers. I with to find out how to
automatically copy them into another row and have them in Ascending numerical
order. I'm at a loss to figure out what function can do this.

Example:
Input 9 4 56 8 2 27

Output 2 4 8 9 27 56

Thanks, Scidoc


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Need to sort a row of data and automatically copy in to another ro

One could make a UDF (user defined function) Are you ready to explore VBA?
best wishes

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

"scidoc" wrote in message
...
I have a row of 6 random ordered numbers. I with to find out how to
automatically copy them into another row and have them in Ascending
numerical
order. I'm at a loss to figure out what function can do this.

Example:
Input 9 4 56 8 2 27

Output 2 4 8 9 27 56

Thanks, Scidoc




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,393
Default Need to sort a row of data and automatically copy in to another ro

Try

Option Base 1

Function sortme(myrange)
Application.Volatile
n = myrange.Count
ReDim myarray(n)
For j = 1 To n
myarray(j) = myrange(j)
Next
For k = 1 To n - 1
For j = k To n
If myarray(j) < myarray(k) Then
holdme = myarray(j)
myarray(j) = myarray(k)
myarray(k) = holdme
End If
Next j
Next k
sortme = myarray
End Function

Need help with VBA? See David McRitchie's site on "getting started" with
VBA
http://www.mvps.org/dmcritchie/excel/getstarted.htm
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Bernard Liengme" wrote in message
...
One could make a UDF (user defined function) Are you ready to explore VBA?
best wishes

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

"scidoc" wrote in message
...
I have a row of 6 random ordered numbers. I with to find out how to
automatically copy them into another row and have them in Ascending
numerical
order. I'm at a loss to figure out what function can do this.

Example:
Input 9 4 56 8 2 27

Output 2 4 8 9 27 56

Thanks, Scidoc






  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Need to sort a row of data and automatically copy in to another ro

Another play to try out ..

Assuming the inputs are in B1 across

In B2:
=IF(B1="","",B1+COLUMNS($A:A)/10^10)
Leave A2 blank

In B3:
=IF(COLUMNS($A:A)COUNT(2:2),"",INDEX(1:1,MATCH(SM ALL(2:2,COLUMNS($A:A)),2:2,0)))
Select B2:B3, copy across to cover the max expected extent of inputs (in B1
across). B3 across will return the required ascending sort of inputs, all
neatly bunched to the left. Duplicate input numbers, if any, are also catered
for.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"scidoc" wrote:
I have a row of 6 random ordered numbers. I with to find out how to
automatically copy them into another row and have them in Ascending numerical
order. I'm at a loss to figure out what function can do this.

Example:
Input 9 4 56 8 2 27

Output 2 4 8 9 27 56

Thanks, Scidoc


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
How can I sort data automatically? surekha New Users to Excel 4 April 9th 07 05:16 PM
Automatically duplicate and sort data into seperate w.sheet Ting Excel Discussion (Misc queries) 1 June 21st 06 02:14 AM
How can I sort a group of numbers automatically as data is entere Adrew Excel Worksheet Functions 4 December 19th 05 12:56 AM
Can an Excel Spreadsheet automatically sort new data? Stumped Excel Worksheet Functions 2 November 8th 05 04:26 PM
how do i automatically sort data in a pivot table Esche Excel Worksheet Functions 1 June 11th 05 12:43 PM


All times are GMT +1. The time now is 06:58 AM.

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"