How to Sort by Second Word in Google Sheets: A Step-by-Step Guide

Sorting by the second word in Google Sheets can be a bit of a head-scratcher, but fear not! It’s actually quite simple once you know the steps. In a nutshell, you’ll need to use a formula to isolate the second word in each cell, and then sort your data based on the results of that formula. So, roll up your sleeves, and let’s dive in!

Step by Step Tutorial on How to Sort by Second Word in Google Sheets

Before we start, let’s make sure we’re on the same page. We’re going to pull out the second word from each cell in a column and then sort your spreadsheet based on those second words. Ready? Here we go!

Step 1: Select a Blank Column

Choose a blank column where you will place the formula to extract the second word.

Finding a blank column is essential because we need space to work our magic. This column will temporarily house the formulas that will extract the second word from each cell in the target column.

Step 2: Enter the Formula

Type the following formula into the first cell of the blank column: `=TRIM(MID(SUBSTITUTE(A2," ",REPT(" ",LEN(A2))),LEN(A2),LEN(A2)))`

This formula might look a bit alien, but it’s not as complicated as it seems. It’s telling Google Sheets to substitute spaces with a really long space, then find the middle of that space, which is essentially our second word.

Step 3: Drag the Formula Down

Click and drag the formula down the column to apply it to all the cells.

Dragging the formula will apply it to the corresponding cells in the target column, ensuring that each cell’s second word is extracted.

Now, with the second words isolated, select your entire data range, including the new column with the second words, and sort by the new column.

Sorting by the new column will rearrange your rows based on the second word in each cell, giving you the sorted data you were after.

After you’ve sorted your data by the second word, you can either leave the formula column as it is or delete it if it’s no longer needed. Your data will stay sorted in the new order.

Tips for Sorting by Second Word in Google Sheets

• Ensure there are actual spaces between words; otherwise, the formula won’t work.
• If there’s only one word in a cell, the formula will return an error.
• Make sure all data you want to sort is included in the sorting range.
• Always perform sorting tasks on a copy of your data to avoid accidental data loss.
• Use the "undo" feature if your sort doesn’t go as planned.

What if I need to sort by the third word or another position in the text?

Modify the formula to suit the position of the word you wish to sort by. For example, you might need to adjust the `MID` function values to target the third word instead.

Will sorting by second word work if there are varying numbers of words in each cell?

Yes, but cells with less than two words will result in an error for those specific cells. You can ignore these errors or clean up your data before applying the formula.

Can I sort by last word instead of second?

Absolutely! You would need to adjust the formula to find and isolate the last word in each cell.

What if my data is separated by commas instead of spaces?

You would need to modify the formula to recognize the comma, `,`, as the separator instead of the space.

Can this method be applied to rows instead of columns?

Yes, but it requires adjusting the formula and the range you’re applying it to. The concept is the sameâ€”extracting a specific word to sort by.

Summary

1. Select a blank column.
2. Enter the formula to extract the second word.
3. Drag the formula down the column.
4. Sort your data by the new column.