# need help with this formula

#### shumonsaha

##### Board Regular
Hi

If I have weekdays in a single cell as "WedFriTueSatMonThuSat"

I want to put a formula wherein it gets sorted as "SunMonTueWedThuFriSat"

Is there any excel formula to do it?

### Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

#### mikerickson

##### MrExcel MVP
Why is Sun part of the result?
Are the days always contiguous, might "MonWedFri" be an input string?

Last edited:

#### shumonsaha

##### Board Regular
See, the program A has mon sun wed sat thu for eg

but when I do a Mconcat - unique values it takes in the same order as monsunwedsatthu

I want it to be in order sunmonwedthusat

does that clarify somewhat?

#### mikerickson

##### MrExcel MVP
If "WedFriTueSatMonThuSat" is in A1, the formula

=MID(A1,FIND("Sun",A1&"Sun"),3) & MID(A1,FIND("Mon",A1&"Mon"),3) & MID(A1,FIND("Tue",A1&"Tue"),3) & MID(A1,FIND("Wed",A1&"Wed"),3) & MID(A1,FIND("Thu",A1&"Thu"),3) & MID(A1,FIND("Fri",A1&"Fri"),3) & MID(A1,FIND("Sat",A1&"Sat"),3)

will return "MonTueWedThuFriSat"

"Sun" is not part of the input of your example, I don't understand why it is part of the result. Was that a typo?

#### shumonsaha

##### Board Regular
No Sun is a part of the input.. too... sun stands for sunday and programs on TV can be scheduled in any part of the week.

will try the solution you have given

#### shumonsaha

##### Board Regular
Thanks Mike

That works perfectly

Replies
4
Views
148
Replies
10
Views
446
Replies
1
Views
131
Replies
5
Views
258
Replies
1
Views
1K

1,191,696
Messages
5,988,162
Members
440,131
Latest member
EricMoz

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