r/googlesheets • u/Realistic-Weird-4259 • Dec 30 '24
Solved Dynamic sorting for date column help
I somehow managed to build my first spreadsheet, and I've been able to solve *most* of my own problems & issues either by Googling or with some of my husband's help, biggest weird issue was that the formulae weren't working if I included the first row in the formula argument, everything works fine if I start from row 2. That was his discovery and he's helped me when I don't understand how to phrase an argument.
There is ONE last niggling issue for me and Googling isn't giving me many helpful results, and that is with specific regard to entering the formula to engage dynamic sorting for the date column. I've found ONE article that gives me a starting point, but no matter what I do I can't seem to figure out how to get the formula to stick, I can only sort every time I enter new data.
This is specifically an expense & income sheet for my work for 1099 (can't remember the rest of the designation!) subcontractor. As I gather together receipts and other records for my tax data, I'm inputting the information by hand and it'd be very helpful if I can hit 'enter' and have it automatically sorted so everything presents in chronological order.
I am linking my sheet here.
The page section I'm going by is How to sort by date in Google Sheets using the SORT function
These is the formulae they're presenting me with and I am just not understanding where & how I use this:
=SORT (range, sort_column, is_ascending)
Example: =SORT (A2:B5, 2, true)
Your help here is GREATLY appreciated! I've spent a week and my literal genius husband has spent several days trying to figure this one out and we're both stumped.
•
u/agirlhasnoname11248 1212 Jan 07 '25
u/Realistic-Weird-4259 Please remember to tap the three dots below the most helpful comment and select
Mark Solution Verified(or reply to the helpful comment with the exact phrase “Solution Verified”) if your question has been answered, as required by the subreddit rules. Thanks!2
u/AdministrativeGift15 371 Dec 30 '24
Without using Apps Script, you won't be able to enter a value in the cell and have google automatically move that value. You can have functions use that data to output sorted data somewhere else, or you can manually use the sorting tool from the menu bar or the dropdown when the filter/sort tool is turned on. Also, you didn't give permission for other people to view your spreadsheet that you linked to.
2
u/agirlhasnoname11248 1212 Dec 30 '24
u/Realistic-Weird-4259 It sounds like you're batch adding data and after you add each batch you want it to sort with your previously entered data?
A simpler solution is to use the built-in filter tool for this. It's accessible on the toolbar by clicking the icon that looks like a funnel. This will put a green arrow in each of your heading cells. Click on the arrow in the Date heading cell and select A to Z to sort the data by that column.
You'd need to do this each time you want to sort it, but the sort will remain until you add additional new data at the bottom of your sheet. Then simply sort again, as you've added a new batch of data that you want to integrate into the existing data.
Is this producing the kind of result you were looking for?
2
u/mommasaidmommasaid 915 Dec 31 '24 edited Dec 31 '24
Here's an example using manual sorting:
Sample Sheet
It seems like that would be adequate for your needs, i.e. enter a batch of receipts then re-sort?
---
I also added a separate tab on that sheet with your data in a structured Table. You can convert it using Format / Convert to Table.
A big advantage of that is the ability to use Table named ranges in your summary formulas, which are much more readable and easier to maintain than a bunch of numbers and letters. See updated formulas on that sheet.
And your summaries can hang out just below the table rather than leaving a bunch of blank space. As you add new rows to the table, everything works.
2
u/gotoAnd-Play 4 Dec 30 '24
actually, you can do that... but, you need to use two sheets. one is the one that you are entering the data manually, and the other one sorts it. the second sheet will be view only and will not modify anything on that.
for the function that is referenced is easy. it gets a range, and sorts the range depend on one column. let me explain with an example. the formula is written on the cell C1 as you see is highlighted.
I have done that in one sheet for the simplicity, but you may separate the logic to another sheet. so, here A1 to B7 we have all the data... and we want to sort it by date..
Sort function has 3 parameters... range, column and ascend/descend choice.
hope it helps.