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

#### jimblimm

##### Board Regular
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

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
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", "")

STUPID QUESTION,,, but what does the A1:J1 do

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

Another way:

=TEXT(SUMPRODUCT(LARGE(--MID(E11,{1,2,3,4},1), {1,2,3,4}),{1,10,100,1000}), "0000")

Last edited:
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

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.

thanx a mill

Replies
0
Views
318
Replies
4
Views
521
Replies
0
Views
202
Replies
3
Views
593
Replies
13
Views
1K

1,211,680
Messages
6,103,247
Members
447,850
Latest member
thebuzzman15

### 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.

### Which adblocker are you using?

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

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