need help with this formula

shumonsaha

Board Regular
Joined
Mar 22, 2009
Messages
56
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
Joined
Jan 15, 2007
Messages
24,348
Why is Sun part of the result?
Are the days always contiguous, might "MonWedFri" be an input string?
 
Last edited:
Upvote 0

shumonsaha

Board Regular
Joined
Mar 22, 2009
Messages
56
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?
 
Upvote 0

mikerickson

MrExcel MVP
Joined
Jan 15, 2007
Messages
24,348
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?
 
Upvote 0

shumonsaha

Board Regular
Joined
Mar 22, 2009
Messages
56
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
 
Upvote 0

Forum statistics

Threads
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.
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
Top