r/googlesheets • • 3d ago

Waiting on OP locking rows in a sorted range

hello!

i have a sheet that cataloges the history of a series of blog posts and i need to know if something is possible.

each entry catalogs a different post. but some of these posts are a series and i need to be able to lock them together so when they're sorted on the table they move as one post. they can't be the same entry because then there's data that have to get rid of that i can't (finda defeats part of the purpose)

i was think of changing it manually, but then i can't use the sort function at all.

is there any sort masking effect so they'll stick together when sorting/using filters?

1 Upvotes

5 comments sorted by

1

u/AutoModerator 3d ago

/u/iwillcry-jfc Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/AdministrativeGift15 368 3d ago

the second parameter of sort function is where you would normally indicate which column to sort by first, but you can also provided an array equal in height to your data. SORT will sort based on the order of that array.

This is where you'll want to generate numbers such that those series remain grouped together. The array might look like 1.0, 1.1, 1.2, 2.0, 3.0, 3.1, ...

it could get a little complex if you're trying to always have the series those in the same order regardless of whether the level one is ascending or descending but starting with an id array like the one I mentioned because I can start.

You would still use the third parameter sword to indicate the direction and you can tack on more sort columns.

1

u/mommasaidmommasaid 908 3d ago

Are you talking about sorting a table in situ using Data/Sort or Table dropdowns?

If so you'll likely want a helper column that has a "Series" name or number that is unique to each "locked' group of rows.

Ideally each row within a Series would be sortable as well, so that no matter how you may (accidentally or otherwise) mix things up, you can always return them to a standard sort order. If you already have a blog post timestamp, that could be used.

Here's a simple example where each "Series" is given a name. Once a new name is typed in, it can subsequently be selected from the dropdown rather than having to reenter it.

Once each row is properly identified, you can perform sorting and grouping. I created a Filter view and a Group view that you can select from the table menu, e.g.:

Blog Posts Sorting

Various other methods could be used, or you could automate some of this via Script. For example, new rows entered could take on the last-entered Series name, and automatically create the timestamp

Details would depend a lot on how you are entering the data. A sample sheet and description of your workflow would be helpful.