Help

Re: Alphabetical Sorting within a Cell

24276 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Sherman
6 - Interface Innovator
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
Sho
11 - Venus
11 - Venus

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

Sherman
6 - Interface Innovator
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!

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

 

heenas34
4 - Data Explorer
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.
Google Sheets:

Text to Columns (Optional):

Similar to Excel, you can use the "Split text to columns" feature in Google Sheets to separate data if it's delimited.
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):

You can use a similar array formula as described for Excel in Google Sheets to sort within a single cell.
Remember that these methods are based on the assumption that the data within the cell is either separated by a delimiter (e.g., commas) or structured in a way that allows for splitting. If your data is more complex or doesn't follow a consistent pattern, additional data preparation steps may be needed before sorting.