ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Reversing the order of data separated by commas within a cell? (https://www.excelbanter.com/excel-discussion-misc-queries/219852-reversing-order-data-separated-commas-within-cell.html)

rome330

Reversing the order of data separated by commas within a cell?
 
I have an index of paragraph numbers that I imported from Word. The numbers
are currently listed in each cell in highest - lowest order. Is there a
formula that will allow me to reverse the order?

John[_22_]

Reversing the order of data separated by commas within a cell?
 
Hi
Try this : =INDEX($A:$A,50-(ROW(A1)-1)) adjust range to your needs
HTH
John
"rome330" wrote in message
...
I have an index of paragraph numbers that I imported from Word. The
numbers
are currently listed in each cell in highest - lowest order. Is there a
formula that will allow me to reverse the order?



Pete_UK

Reversing the order of data separated by commas within a cell?
 
Can't you just sort them using Data | Sort and specify the sort order?

If they are an awkward format which won't sort very easily, you can
add a simple sequence 1, 2, 3, 4 etc to cells in the adjacent column
and then highlight both sets of cells and do Data | Sort choosing the
second column as sort field and sort in decreasing order. Then you can
delete the helper cells.

Hope this helps.

Pete

On Feb 9, 5:29*pm, rome330 wrote:
I have an index of paragraph numbers that I imported from Word. *The numbers
are currently listed in each cell in highest - lowest order. *Is there a
formula that will allow me to reverse the order?



Gary''s Student

Reversing the order of data separated by commas within a cell?
 
Try this small UDF:

Function mirror(r As Range) As String
s = Split(r.Value, ",")
mirror = s((UBound(s)))
For i = UBound(s) - 1 To 0 Step -1
mirror = mirror & "," & s(i)
Next
End Function

so that if A1 contains:
17,23,11,7,51
=mirror(A1) will display:
51,7,11,23,17


--
Gary''s Student - gsnu200832


"rome330" wrote:

I have an index of paragraph numbers that I imported from Word. The numbers
are currently listed in each cell in highest - lowest order. Is there a
formula that will allow me to reverse the order?


Gord Dibben

Reversing the order of data separated by commas within a cell?
 
Public Function RevStr(rng As Range)
RevStr = StrReverse(rng.text)
End Function

Currently.....................7,6,5,4,3,2,1

=Revstr(cellref)

Returns.......................1,2,3,4,5,6,7


Gord Dibben MS Excel MVP

On Mon, 9 Feb 2009 09:29:10 -0800, rome330
wrote:

I have an index of paragraph numbers that I imported from Word. The numbers
are currently listed in each cell in highest - lowest order. Is there a
formula that will allow me to reverse the order?



Shane Devenshire[_2_]

Reversing the order of data separated by commas within a cell?
 
Hi,

I could give you a fancy formula but:

Suppose your column of data is A1:A1000
In B1 enter 1
In B2 enter 2
Highligh B1:B2 and drag the fill handle down as far as your data.
Sort on Column B in Descending order

--
If this helps, please click the Yes button

Cheers,
Shane Devenshire


"rome330" wrote:

I have an index of paragraph numbers that I imported from Word. The numbers
are currently listed in each cell in highest - lowest order. Is there a
formula that will allow me to reverse the order?



All times are GMT +1. The time now is 07:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com