# Re: Alphabetical Sorting within a Cell

11245 1
cancel
Showing results for
Did you mean:
6 - Interface Innovator

Is there a way to sort the contents of a cell alphabetically?

If I create a cell that is gathering data from other sources (linked file, concatenated), can I then take that data and arrange it alphabetically? I'm struggling to find anything that works with the data in a single cell.

Thank you for any tips you might have!

4 Replies 4
11 - Venus

By other source, do you mean a table in another Base using Sync, or another table in the same Base?

6 - Interface Innovator

If either works I'd figure it out! I am currently working with linked fields from another table in the same base. I will likely have to concatenate a field from multiple fields and then hopefully sort that field. So, field A, B, and C are multi-select linked fields, D will concatenate all three, and then ideally field E would sort field D alphabetically... That last step is the one I'm not sure exists, or if there is some workaround I'm not seeing. Thanks!

6 - Interface Innovator

Hmm... Airtable doesn't seem to like those functions. I appreciate it though!

4 - Data Explorer

If you have data within a single cell in a spreadsheet program like Microsoft Excel or Google Sheets, and you want to sort the contents of that cell alphabetically, you would typically need to use a combination of functions or methods to achieve this. Here's a general approach:

Excel:

Text to Columns (Optional):

If your data in a cell is separated by commas or another delimiter, you can use Excel's "Text to Columns" feature to split the data into separate cells in the same row. This can make it easier to sort.
Sort Function:

In a nearby cell, you can use the SORT function to sort the values from your original cell alphabetically.
For example, if your original data is in cell A1, you can use a formula like =SORT(SPLIT(A1, ",")) to alphabetically sort the comma-separated values.
Array Formula (Alternative):

If you want to perform this sorting within a single cell, you can use an array formula.
Select a cell where you want the sorted result to appear (let's say B1).
Enter the following formula as an array formula (Press Ctrl + Shift + Enter instead of just Enter after typing the formula):

=TEXTJOIN(",",TRUE,SORT(FILTERXML("<t><s>" & SUBSTITUTE(A1,",","</s><s>") & "</s></t>","//s")))

This formula assumes your data is comma-separated.