Use Formula to sort two strings

R

Ray Ray

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
 
D

David Biddulph

From the look of the OP's example, perhaps he wants:
=IF(A1<B1,A1&"-"&B1,B1&"-"&A1)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top