You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Order function for two cells. Combined into one

I have 2 alpha cells and I want a third cell to combine the 2 with the letters to be in order by cell. Ie if I have “DEC” in the first cell and “ABF” I the second cell I want the third to read “ABF DEC”

i have this code to combine but need to order them: ""&1stCell&""&" "&""&2ndCell&""

where the 1stCell and 2ndCell is the actual cell code

please help

iPad, iPadOS 17

Posted on Oct 29, 2024 8:17 AM

Reply
2 replies

Oct 29, 2024 11:50 AM in response to CDBSI-1

If I understand the ask correctly, you want the third field to combine the other two fields in alphabetical order, right?



There is no built-in sort function at this level, but if you're just dealing with a couple of fields, a simple IF() statement should suffice.


A2<B2 will return TRUE if A2 is alphabetically lower than B2, or FALSE if it's greater. This can be used in an IF() statement:


=IF(A2<B2, A2 & " " & B2, B2 & " " & A2)



so IF() A2 is less than B2, it returns A2 & " " & B2, otherwise it returns B2 & " " & A2

Order function for two cells. Combined into one

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.