![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Join Date: Oct 2004
Posts: 1
|
What is the formula used for sorting a series of numbers/digits into Terminal Digit Order, using MS Excel? For example: 1234560 Terminal Digit Order: 60452301 |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Dec 2003
Location: Oregon, USA
Posts: 9,755
|
Hello RPK,
For those of us who don't know what Terminal Digit Order is, would you mind explaining it to us? This would help in coming up with a solution.
__________________
Regards, Zack Barresse All Excel Functions (If you would like comments in any code, please say so.) |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2004
Posts: 4,814
|
Hi
You will probably have to build a UDF. If I have the process correctly, then the following may work. Function tdo(x) If Len(x) Mod 2 = 1 Then x = "0" & x For i = 0 To Len(x) / 2 - 1 y = y & Right(Left(x, Len(x) - i * 2), 2) Next i tdo = y End Function It will convert 1234560 to 60452301 and 11234560 to 60452311. Tony |
|
|
|
|
|
#4 | ||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: Mar 2004
Location: Oregon
Posts: 13,278
|
Are all your numbers 7 or 8 digits, if so perhaps:
Formula in B1: =--(RIGHT(TEXT(A1,"00000000"),2)&MID(TEXT(A1,"00000000"),5,2)&MID(TEXT(A1,"00000000"),3,2)&LEFT(TEXT(A1,"00000000"),2)) ******** ******************** ************************************************************************>
[HtmlMaker light Ver1.11] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR. |
||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
||||||||||||||||||||||||||||||||||||||||||||||
|
|
#5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
MrExcel MVP
Join Date: May 2003
Posts: 8,474
|
Hi,
Never heard of terminal numbers so maybe I'm completely off here: ******** ******************** ************************************************************************>
[HtmlMaker 2.42] To see the formula in the cells just click on the cells hyperlink or click the Name box PLEASE DO NOT QUOTE THIS TABLE IMAGE ON SAME PAGE! OTHEWISE, ERROR OF JavaScript OCCUR.
__________________
"Fair Winds and Following Seas" |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|