Getting a single cell to list its (4) digits in chronological order

jimblimm

Board Regular
Joined
May 11, 2012
Messages
219
in A1 have the number

4251

The cell b1 should display 1245

currently i have to split the number into 4 cells

c1=left(a1,1) d1=mid(a1,2,1) e1=mid(a1,3,1) f1=right(a1,1)

then i have to concatenate small to large.. its gotta be a simpler way
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
I think this will do what you want
=SUBSTITUTE(SUMPRODUCT(ISNUMBER(FIND(COLUMN(A1:J1),A1))*COLUMN(A1:J1)*(10^(9-COLUMN(A1:J1)))), "0", "")
 
Upvote 0
I think this will do what you want
=SUBSTITUTE(SUMPRODUCT(ISNUMBER(FIND(COLUMN(A1:J1),A1))*COLUMN(A1:J1)*(10^(9-COLUMN(A1:J1)))), "0", "")

This formula works if the number has no "zero" inside and have not two or more identical number inside. See example below:
55103 --> 1351
 
Upvote 0
Another way:

=TEXT(SUMPRODUCT(LARGE(--MID(E11,{1,2,3,4},1), {1,2,3,4}),{1,10,100,1000}), "0000")
 
Last edited:
Upvote 0
the formula works on a number with all different digits but what if i had numbers like

0112
1111
1122

its dropping some of the digits
 
Upvote 0
the formula works on a number with all different digits but what if i had numbers like

0112 This is not a number
1111 Here nothing to move because the number is in format you want
1122 Here nothing to move because the number is in format you want

its dropping some of the digits

shg formula is working for your example.
 
Upvote 0

Forum statistics

Threads
1,214,522
Messages
6,120,019
Members
448,938
Latest member
Aaliya13

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top