Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Use Formula to sort two strings
Dear experts
I design the following spreadsheet. Please advise how I can achieve the result on column C (i.e. it sorts column A and B in ascending order, and puts the smaller string in the front and the bigger one at the back)? A B C 1 Atlanta Los Angeles Atlanta-Los Angeles 2 Orlando Chicago Chicago-Orlando 3 Mexico City Miami Mexico City-Miami -- Best regards Ray Ray |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Use Formula to sort two strings
Put this in C1 and drag down.
=IF(LEN(A1)<LEN(B1),A1&" "&B1,B1&" "&A1) Mike "Ray Ray" wrote: Dear experts I design the following spreadsheet. Please advise how I can achieve the result on column C (i.e. it sorts column A and B in ascending order, and puts the smaller string in the front and the bigger one at the back)? A B C 1 Atlanta Los Angeles Atlanta-Los Angeles 2 Orlando Chicago Chicago-Orlando 3 Mexico City Miami Mexico City-Miami -- Best regards Ray Ray |
#3
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Use Formula to sort two strings
From the look of the OP's example, perhaps he wants:
=IF(A1<B1,A1&"-"&B1,B1&"-"&A1) -- David Biddulph "Mike H" wrote in message ... Put this in C1 and drag down. =IF(LEN(A1)<LEN(B1),A1&" "&B1,B1&" "&A1) "Ray Ray" wrote: Dear experts I design the following spreadsheet. Please advise how I can achieve the result on column C (i.e. it sorts column A and B in ascending order, and puts the smaller string in the front and the bigger one at the back)? A B C 1 Atlanta Los Angeles Atlanta-Los Angeles 2 Orlando Chicago Chicago-Orlando 3 Mexico City Miami Mexico City-Miami -- Best regards Ray Ray |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Ascending Sort formula, change to neg #: descending sort.. | Excel Discussion (Misc queries) | |||
Is there a formula for searching for any one of a list of strings? | Excel Worksheet Functions | |||
How to find number of pairs of strings from list of strings? | Excel Worksheet Functions | |||
Formula to strip figures from cells text strings | Excel Discussion (Misc queries) | |||
How can I count strings within strings | Excel Worksheet Functions |