Тёмный

Automatically Sort Data in Google Sheets 

Learn Google Sheets & Excel Spreadsheets
Подписаться 276 тыс.
Просмотров 140 тыс.
50% 1

Опубликовано:

 

26 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 244   
@RoseLK
@RoseLK 3 года назад
Hi, thanks a lot! Wondering if we can sort multiple columns by using Script editor? Same as when we choose Data > Sort Range > Advanced > Choose multiple columns
@BuGuedes
@BuGuedes 6 месяцев назад
Yes, you can. Instead of stopping at one column description, you may keep going. Exemple: range.sort( [ {column: 3, ascending: true}, // sorted by column 3 {column: 4, ascending: true}, // then sorted by column 4 {column: 1, ascending: true}, // then sorted by column 1 {column: 6, ascending: true} // then sorted by column 6 ])
@kevinsaint20
@kevinsaint20 2 года назад
Thank you! The weight lifting coach at my school uses Google Sheets to input scores at the meets and he said his biggest gripe was that the totals don’t sort so the other teams know who is currently winning, etc. Used your functions and just had to change the ‘column’ condition inside the if statement from “column === max” to “column
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Great!
@kevinsaint20
@kevinsaint20 2 года назад
@@ExcelGoogleSheets if there were several other pages that I wanted to do a similar thing for, would I have to create an entirely different script? Having trouble replicating it. In the other sheets, I can’t even use the sort filter for some reason. You can see it sort for a split second and then it goes back to the way it was immediately
@alanis7857
@alanis7857 2 года назад
In case you don't find "Script Editor" under tools, it might be under extensions now.
@cmozify
@cmozify 2 года назад
I've truly appreciated many of the videos you're shared. As a newbie to Apps Script, I attempted replicating to "autosort" only the active sheet but encountered this error: >> TypeError: Cannot read property 'range' of undefined All function errors including onEdit: gs:2 and gs:19 const range = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,7) Only two things are different from your video example: 1) my table has data starting at Column 1 instead of Column 2 and 2) the active sheet is called "Stat Journal". What missteps have I done? Pointers and trouble-shooting tips would be appreciated! -------- (COPIED CODES) -------- function mySort(e){ const row = e.range.getRow() const column = e.range.getColumn() const ss = e.source const currentSheet = ss.getActiveSheet() const getSheetName = currentSheet.getSheetName() if(!(currentSheetName === "Stat Journal" && column === 7 && row >= 2)) return const range = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,7) range.sort({column: 7, ascending: false}) } function onEdit(e){ mySort(e) }
@sam32rahman
@sam32rahman 2 года назад
Same thing is happening to me...everything worked fine until he started moving things around for personal preference.
@marvinjaysamalca4988
@marvinjaysamalca4988 2 года назад
Any fix on this?
@imputedrighteousnessminist2474
@imputedrighteousnessminist2474 2 года назад
FINALLY!!! ALL the other sites--except for one or two which weren't good at teaching IMO, kept mentioning the filtering, which is VERY annoying, since it's not dynamic. THANK YOU THANK YOU THANK YOU!!! WHAT A HUGE HELP!!! IT LOOKS AWESOME!!! :) :) :)
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
🙂👍
@suprantes
@suprantes Год назад
After seeing this tutorial 30++ times I can do on my own Thank you Sir
@alifitroni95
@alifitroni95 2 года назад
Why it not work on my spreadsheet ? TypeError: Cannot read property 'range' of undefined
@garychadwick1240
@garychadwick1240 3 года назад
Everything you teach works perfectly and is incredibly useful. Thank you!
@AadityaDwivedi-o2c
@AadityaDwivedi-o2c 6 месяцев назад
This works if I am making the edits manually, but not when the data is pushed in through an automated Zap process. can anyone help me out here please?
@Paul-ly1pw
@Paul-ly1pw 5 месяцев назад
Brilliant video, thank you. I’ve been trying to make something similar work and failed until now. Can I ask how you code an extra feature? I have a jobs list and there is a column for the status (new, assigned, completed) but also a priority column. I would like to sort by status but within each status, I would like to sort by priority. how would i do that?
@sbhanuprakash9
@sbhanuprakash9 3 года назад
This is awesome!!. Is it possible to sort the data with a specific date which we enter on any cell and it should sort ascending order according to the specified date. can this be done? It would be a great help for me.
@runic6724
@runic6724 2 года назад
I have done my code exactly like yours except with values from my sheet in it and I'm getting error "Cannot read property 'range' of undefined". I cannot tell what I'm doing wrong. Here's my code. Help? function autoSort(e){ const row = e.range.getRow() const column = e.range.getColumn() const ss = e.source const currentSheet = ss.getActiveSheet() const currentSheetName = currentSheet.getSheetName() if(!(currentSheetName === "School Assignments" && column === 5 && row >= 2)) return const range = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,6) range.sort({column: 5, ascending: true }) } function onEdit(e){ autoSort(e) }
@GiladOfir
@GiladOfir 3 года назад
Great video, should we copy the script from the video or there is easier way to get it? 😃
@ksugaris6941
@ksugaris6941 Год назад
Thank you for your knowledge sharing. one step further for slicker appearance and better fuctionality would be to have a separate line only for input and when finish input automatically sort in the table.
@DWisinIT
@DWisinIT Год назад
🥰AWESOME THANKS! Can you please show one where it sorts like this, but it is ordered in a specific way for example: On edit of Column C, it orders the data : NorthEast, South, West, MidWest ?
@jayliu9998
@jayliu9998 2 года назад
Very helpful, thank you! and can you plz tell me how to stop the script if I don't want the sheet to be sorted automatically?
@ge8449
@ge8449 3 года назад
Hello. Thank you very much for your explanation on this video. I have a question regarding to sort an entire row, if X cell have value "Y" or X cell have TRUE value from checkbox. So for this case, if it cell have crossed, the entire row will automatically sorted to the bottom. Could you please make the video for this problem? Thank you in advance
@austincrouse5991
@austincrouse5991 2 года назад
I continually receive an error indicating "Cannot read property 'range' of undefined." for line 2. Does anyone have any thoughts?
@MagickUnleashed
@MagickUnleashed 2 года назад
I am getting the same error. I did everything the same so not sure what’s wrong.
@slalomdrags
@slalomdrags 2 года назад
what if I have a function already in the last column that I want to auto sort? I tried auto sorting with the simple fx=SORT(range, sort_column, is_ascending) and it wouldn't do it because I already had a SUM function for that column from the 2 columns to the left of it. Any suggestions?
@NTR-OTC
@NTR-OTC 2 года назад
Your tips are great, thank you. I have a question and a scenario and I don't explain myself well so please, hang in there with me while I try. I have two live feed cameras that track trains. We keep track of all trains that pass us on Google Spreadsheets on a very impressive-looking log. We know how long it takes to get from one point to another from one cam to the other. What I am thinking of is when we enter a time on one location, somehow the background color changes on the other location's time slot for 15 minutes to a light color. Then 5 minutes a darker shade, then 5 minutes a darker one. After 30 minutes, or whatever prescribed time, after the train was due, I was kind of hoping to make the background change to make it appear to be blinking. If I made myself clear, is something like this even possible and if so where would I go to learn how to do this?
@itzshowtime__4800
@itzshowtime__4800 3 года назад
Thank you for the quick answer to my questions !
@taylorgowan7970
@taylorgowan7970 2 года назад
CAN ANYONE EXPLAIN WHY I AM GETTING A RANGE ERROR AND THIS IS NOT WORKING?? function autosort(e){ const row = e.range.getRow() const column = e.range.getColumn() const ss = e.source const currentSheet = ss.getActiveSheet() const currentSheetName = currentsheet.getSheetByName() if(!(currentSheetName === "Inspectors sheet" && column === 1 && row >=2)) return const range = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,15) range.sort({column:1,ascending:true}) } function onEdit(e) { const row = e.range.getRow() const column = e.range.getColumn() if(!(currentSheetName === "Inspectors sheet" && column === 1 && row >=2)) return autosort(e) }
@blizzardy858
@blizzardy858 2 месяца назад
i'm having an issue where it's only checking the first number, but the code looks exactly the same but also something weird: i enter 11.12, and 10.98, but 11.12 goes to the top, yet i have the sort set to ascending: true however the sorter has functionality, it is just doing the wrong thing
@brianb4792
@brianb4792 Год назад
The auto-sort script is great but only sorts for my account, the account Owner. The Sheet is shared with three other Editors. Auto sort does not work for them at all. Any insights would be greatly appreciated. Thank you for the great tutorial!!
@sankarbiswas5945
@sankarbiswas5945 10 месяцев назад
Thank you for the great tutorial! Is it possible to apply autosort on more than one tab in Google Sheets with different conditions?
@trevormills8338
@trevormills8338 6 месяцев назад
Awesome, content, didn't know I could do this. Do you have a tutorial on sorting by a specific row? What is its not the last column. I want to sort a list by number of hospital beds. But I don't want to change the total count at the bottom of the page. I want to sort the list of hospital names, by the Highest number of Hospital Bed count. Is there a video, I could watch to figure this out from? Please and thank you for your time.
@uThirstyP
@uThirstyP 2 года назад
Great video! Thank you! 🙏🏼 Question: Can this be used to auto sort any check box ☑️ to the top of the list if it’s check
@benicio_cuna
@benicio_cuna 2 года назад
If you could post the script on the description also, it would be very nice and simple. Then we use your explanation to update the script according to our data
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
It's available to channel supporters on Patreon www.patreon.com/chicagocomputerclasses
@benicio_cuna
@benicio_cuna 2 года назад
@@ExcelGoogleSheets ok. Thank you
@MegaAcord
@MegaAcord Год назад
Thank you! Great Video. Nevertheless, I'm having a problem when I copy and paste new data at the end of the sheet. The onEdit() doesn't refresh. It seems to work only when I type new data in the desired cell. Any suggestions? Thank you again.
@lukemenzel3513
@lukemenzel3513 2 года назад
I am having trouble once I get to timestamp 8:44. When I run the script it will sort the values how I want them to but when I input a new number into the last column it does not auto sort. What could I be doing wrong? Any feedback would be greatly appreciated.
@mumtahina118
@mumtahina118 Год назад
I am having the same problem :(
@AJ_9202
@AJ_9202 Год назад
Hello! Thank you very much. Is it possible to do this on different sheets. In this case the script runs on "My Sheet". Lets say that I have another sheet that is called "Adams Sheet" is it possible to have to different scripts running at the same time on edit? I am not getting to work. Would appreciate an answer. Thank you
@rossettekylabalunan4241
@rossettekylabalunan4241 2 года назад
hi! quick question, how can i add this function to a different sheet on the same file, though it has a different number of columns. do i just repeat the same program?
@NurAfiqahSalman
@NurAfiqahSalman Год назад
Hey there , i would need to edit a data sheet that has no amount but instead of “completed” “Pending” “ongoing”. How to i edit those in the Script Editor.
@abhijeetkumar8830
@abhijeetkumar8830 Год назад
Hi Thanks for the superb video but in my case error is coming in the second line Cannot read property 'range' of undefined What should I do about this
@vcfborges
@vcfborges 3 года назад
hi thanks for the tutorial, I am trying to implement it with a doPost method where I add rows to the sheet but it does not recognize me as an event that causes the values ​​to be ordered according to the column I choose, it only works when I edit a value of that column on the sheet, how could I do?
@JaleyCWD
@JaleyCWD Год назад
Thank you! So quick question: my sheet is now auto-sorting when I manually add a new row, but data that populates from google form responses does not automatically get sorted. Anyone know how to fix this?
@amirbehvar2859
@amirbehvar2859 3 года назад
very nice vid! I have two spreadsheets, I put the data in the first one and based on criteria data will be shown on the second spreadsheet, I was wondering if there was a script (I currently do it with filters manually) that I could auto hide blank rows on the second sheet and as soon as they get data they turn unhide. Thank you
@m820683
@m820683 2 года назад
Thank you very much this is a great video, learned and takes a lot. I am from Mexico City, even though my English is somewhat limited, I felt that I should at least thank you. Best regards.
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Thanks! Your English seems great to me!
@asevero
@asevero 3 года назад
Edit: the script is working, but I don't know why this error keeps showing when trying to run the script. I am trying to run the script but this error appears: Error TypeError: Cannot read property 'range' of undefined autoSort @ Code.gs:2 Double checked many times and can't find the problem! Help please!
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
You can't manually run this function, because it can't work without an "event". It needs to automatically run when you make changes on the spreadsheet.
@asevero
@asevero 3 года назад
@@ExcelGoogleSheets Thanks! It was working but I did not understand the error. Now I got it.
@rolieldu38
@rolieldu38 9 месяцев назад
I'm stuck, I cant get the auto to work, and also where can I find the Last row video ?
@alliillilliii4365
@alliillilliii4365 2 года назад
How do I make sure so that when anyone change the sheet, the script will trigger? For now it only work when I edit the sheet?
@p8196
@p8196 Год назад
It didn't work for me. I'm using Appsheet to add a row to a google sheet and for some reason the script does not activate. It works perfect when I add a row manually. Any suggestions?
@williamdutton3321
@williamdutton3321 Год назад
Is there a way to make this work for multiple work sheets within a spreadsheet? I've tried making a script for each sheet however it only auto sorts the sheet with the most recent executed script. I'm super green to writing scripts... thanks for the help!
@Guesshaus
@Guesshaus 7 месяцев назад
Entered this function autoSort(){ const ss = SpreadsheetApp.getActiveSpreadsheet() const ws = ss.getSheetByName('TRANSACTIONS') const range = ws.getRange(1,2,ws.getLastRow()-1,7) range.sort({column: 1, ascending: true}) } got Exception: Cell Reference out of range... I am sorting by column 1 by a date which I will enter last as you indicated using the last column instead. What is the issue here?
@estanciahighschoolbaseball3610
@estanciahighschoolbaseball3610 3 года назад
Hello - is there anyway to change the function so it sorts only when the active spreadsheet is edited, rather than when any tab within the sheet is edited?
@samway2221
@samway2221 2 года назад
Hey brother, this all works great for me, no issues, But is there a way for me to pick & choose which 'sheets' I want this added to? For example I have "XYZ Group of Sheets" which contains Sheet1, Sheet2, Sheet3 within the "XYZ Group of Sheets". Say I wanted to add this script formula to Sheet1 & Sheet3, is this possible?
@ikhlaasarif
@ikhlaasarif 2 года назад
This is such a beautifully detailed video!
@royz_1
@royz_1 3 года назад
Exactly what I needed. Thanks!
@ArmadusMalaysia
@ArmadusMalaysia 2 года назад
Is it possible to keep the first row empty so that we can add details to it without scrolling all the way down?
@Sus_Sou
@Sus_Sou 3 года назад
Thank you for the video. Your video really help me.
@roshanbothra8345
@roshanbothra8345 3 года назад
It's nice, can you tell us, is it possible to auto highlight the active cell in sheets
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Even though it's technically possible, it would be very slow and unpleasant to work with.
@jhuensagun9526
@jhuensagun9526 2 года назад
Thank you so much. Now I know how to automatically sort my google sheet. But how about if there are more than 1 conditions? say, I want to autosort by SALES, then by CATEGORY then by SALES REP. Is it possible? Thanks in advance
@belgradeboy77
@belgradeboy77 3 года назад
Thanks a lot for sharing these. I was wondering if there is a way to set up the script for multiple tables under the same sheet?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Yes, it's possible.
@matosumi7622
@matosumi7622 3 года назад
Hey, I have tried this but it does not work for me. In my case I need to Auto-Sort the data if the sheet changes in anyway. The data is entered by another worksheet (from google forms). Any idea how to fix that? If I enter anything manually it work. GREAT TUTORIAL
@RuhinazVlogs
@RuhinazVlogs 3 года назад
Will it work if sheet name is changed? For ex: You are mentioning the sheet name as "My Sheet". If someone changes the sheet name will that gets auto change in script or not?
@Cc-vu9mr
@Cc-vu9mr 3 года назад
can you do it so it sorts it when all cells of the row aren't blank instead of when you edit the last one?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Sure, you can add another if statement and check if the content in all columns != "" then sort.
@JovanSilvera
@JovanSilvera Год назад
What if you would like to sort by multiple criteria?
@arishmanalastas4781
@arishmanalastas4781 3 года назад
Hello! does this do even if the data is edited that comes from another sheet because it's linked?
@tonyharion9816
@tonyharion9816 3 года назад
Super cool!! I have to get my hands on training some more scripts for sheets!
@TheTramos00
@TheTramos00 3 года назад
Simple and useful ! ...... Question : Your videos using Bootstrap, Materialize and Metro UI are really unique on RU-vid, may be anytime soon we can see more videos ? Maybe userforms for searching and displaying the results inside the userform ? userforms with data validation ? Also more of map(), reduce(), filter() ..... Thanks.
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
I already have videos covering all of this. Check on the channel.
@TheTramos00
@TheTramos00 3 года назад
@@ExcelGoogleSheets Thanks for the reply. I've seen most of them ! what I mean is if you are not going to make other videos with more examples about that.
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
@@TheTramos00 There will be a new one coming tomorrow.
@TheTramos00
@TheTramos00 3 года назад
@@ExcelGoogleSheets Great, I'll keep my eye out
@kevinspaeth5895
@kevinspaeth5895 2 года назад
I have been playing around with the code tonight and I can not get it to work properly, for what I need done. In short, I have several rows of data being sorted by the date entered in column B, after the input in Column G (7), but also want the sort to work on the same row if there is data entered into Column H (9). I want the sort to work with sorting by the dates in column B if there is a Debit or Credit value (Column G or H). I have tried many times to play around with the code to get this to work, but either the Apps Script pukes or the sort will not run. If you can help, that would be great! Here is the code I have currently: function autoSort() { const ss = SpreadsheetApp.getActiveSpreadsheet() const ws = ss.getSheetByName("Sheet1") const range = ws.getRange(2,2,ws.getLastRow()-1, 8) range.sort({column: 2, ascending: true}) } function onEdit(e){ const row = e.range.getRow() const column = e.range.getColumn() if(!(column === 7 && row >=2)) return //if(!(column === 8 && row >=2)) return autoSort() //if(!(column === 7 && row >=2)) return //if(!(column === 8 && row >=2)) return autoSort() } My headers for my spreadsheet are as follows: DATE (**) SECURITY ACTION QUANTITY (or 2:1 Split ex.) PRICE PER SHARE PAYMENT (-) DEPOSIT BALANCE Column A is in front of the Date column shown above, so the Date column is column 2. I hope I explained it well enough on what I am trying to get done. As of right now, if I enter a row of data, when I put a value in the Payment column, the row will be sorted with the data directly above, by the date entered for that particular row being added into the spreadsheet. Thanks! Kevin
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
if(!( [7,8].includes(column) && row >=2)) return
@venkab5438
@venkab5438 3 года назад
@ Learn Google Spreadsheets is it possible to auto sort based on different row colors?
@bruno_veloso
@bruno_veloso 3 года назад
Well done! Did you learn javascript first or did you go directly google appscript?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
I've learned JavaScript for other reasons. Contrary to what most people believe, I don't write apps script code very often.
@bruno_veloso
@bruno_veloso 3 года назад
@@ExcelGoogleSheets i've been struggling learning javascript. Do you have any tip? Learning javascript so far is pushing me into learning html and css and i'm not intereted in developing websites, I'm more into self-service usage.
@asevero
@asevero 3 года назад
Thanks a lot! Great tutorial!
@otishendryx
@otishendryx 3 года назад
Firstly, thanks so much for this! It has been a great help! I’m so sorry if this is a “rookie” question, but I have got your formula working, however I still need to manually click on “run” in order for it to sort any new data that is entered. Did I miss a step somewhere?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Check your onEdit and if statement. Remember everything is case sensitive.
@bluestreak711
@bluestreak711 2 года назад
How do I sort by column instead of by row? I need to sort horizontally instead of vertically.
@hiptobedad
@hiptobedad 3 года назад
This is really great, but I am getting an error: 'TypeError: Cannot read property 'range' of undefined' This is my code: function autoSort(e){ const row = e.range.getRow() const column = e.range.getColumn() const ss = e.source const currentSheet = ss.getActiveSheet() const currentSheetName = currentSheet.getSheetByName() if(!(currentSheetName === "Phone Sheet" && column === 1 && row>=2)) return const range = currentSheet.getRange(2,1,currentSheet.getLastRow()-1,6) range.sort({column: 1, ascending: true}) } function onEdit(e){ autoSort(e) }
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
const currentSheetName = currentSheet.getSheetByName() const currentSheetName = currentSheet.getSheetName()
@hemantdafda2028
@hemantdafda2028 3 года назад
Very useful and quite good explanation. Thanks a lot dear makers.
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
:)
@allibarrett6809
@allibarrett6809 2 года назад
Hi there, I'm trying to organize a Google Spreadsheet by date, earliest to latest. I followed along this video but not sure how your's is moving altogether. The date will move but the row will not move with the corresponding info. Any idea how to fix this? Thanks!
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Make sure you enter the right number of columns when you identify the range size.
@itsdylpickles2335
@itsdylpickles2335 Год назад
Is there a way to have it autoSort by multiple columns using this script (Ex. have sales be sorted within each region that is sorted)? I tried to have two statements under the .sort for both columns but it didn't work. I'm not very knowledgeable on this stuff so help would be appreciated.
@ExcelGoogleSheets
@ExcelGoogleSheets Год назад
.sort([{column: 2, ascending: false}, {column: 1, ascending: true}]);
@marsian8778
@marsian8778 3 года назад
Excelente! Hope next time you discuss about auto lock cell after inserting some data using google script. Thanks!
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Doing this makes no sense based on how user authorization works.
@goldeneagle8259
@goldeneagle8259 Год назад
it works, when entering manually, which is great. But doesn't when I append using API, can you advise why? Probably need some other function, than onEdit(). Now I fixed it. Had to create a custom trigger running this sort function on 'onChange' event. Works like a charm, thanks for this tutorial!
@mumtahina118
@mumtahina118 Год назад
Could you tell me how you got it to start autosorting?
@goldeneagle8259
@goldeneagle8259 Год назад
Now it works, thanks for the tutorial!
@p1rturk598
@p1rturk598 2 года назад
Where is the copy and paste section? I just need a working code to copy and paste onto my sheet.
@haydeepenaranda5315
@haydeepenaranda5315 Год назад
THANK YOU!!! YOU HELPED ME A LOT!!!!
@kitekite8597
@kitekite8597 2 года назад
does this work on google sheets app too when i sync it?
@notherenotanywhere
@notherenotanywhere 2 года назад
Seems to be working but I'm getting the error: "TypeError: Cannot read property 'range' of undefined autoSort @ AutoSort.gs:2". Should I be concerned?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Not really.
@Harry-py6fq
@Harry-py6fq 3 года назад
How do you make it sort automatically when the numbers change on their own without any input from you? Otherwise, this script works perfectly! Thank you for sharing.
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Other than scheduling the script to run every x minutes, there is no other way at the moment.
@Sulaimangalib
@Sulaimangalib 3 года назад
How to do a universal conditional format for multiple workbook?
@emadeddinferdowsi7979
@emadeddinferdowsi7979 3 года назад
Really helpful! I looked so much for sth like this! Thank you!
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Glad it was helpful!
@ramuakula8225
@ramuakula8225 3 года назад
it's very useful to me ....Thank you Very much🙏👍 Sir...
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Great!
@lizn9324
@lizn9324 2 года назад
Thank you for this easy to follow video! Can you please explain the difference between the Sort Range and Create Filter function? The both seem similar. I was able to figure out how to do the Create Filter when there is only one header row/column but the my spreadsheet has the same header names in three or four different sections on the same sheet and I don't know how to do that. Is this even possible?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Not with filters, but you can use sort on multiple separate ranges.
@lizn9324
@lizn9324 2 года назад
@@ExcelGoogleSheets Thanks for answering my question. :)
@bryan.gonzales
@bryan.gonzales 6 месяцев назад
how would I do this to sort by date?
@siddharthjain6629
@siddharthjain6629 3 года назад
Nice work. I appreciate your work
@thinusenslin
@thinusenslin 2 года назад
Must the sheet be open to autosort or can I push data via api and it will still autosort?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
You can add a callback function to your script that is pushing data via api.
@phildalton5352
@phildalton5352 Год назад
Thanks for the help video, seems far too complicated for such a simple goal to make it sort them automatically. You would think they should of made this easier in the first place though as if you've sorted once should have the extra option to make this automatic, would think most users would want automatic as default. Oh well I'll look for an alternative.
@hiew04
@hiew04 2 года назад
Hi, I copy paste your code but I get this, how to fix it? TypeError: Cannot read property 'range' of undefined
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
Don't manually run the function, it should run when you make changes.
@Heliuage
@Heliuage 3 года назад
Is it possible to make autosorting in column "A" + column "B"? In case column "A" has the same value - it would by sorted by column "B"
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
.sort([{column: 1, ascending: true}, {column: 2, ascending: true}])
@Heliuage
@Heliuage 3 года назад
​@@ExcelGoogleSheets Thank you for your answer. I used modifed mikebranski's script: gist.github.com/BenoitDuffez/71dada8033e733d57f251d92de638ba4 The problem is that it works only onOpen and onInstall, whenever I try autoSort i receive following error: TypeError: Cannot read property 'getDataRange' of undefined autoSort @ code.gs:66 Because of that it doesn't work, do you know what should be changed?
@koungsareth8623
@koungsareth8623 3 года назад
Please do more complicated app script toturials.
@eternalquest1468
@eternalquest1468 Год назад
👍Great Video. Thanks a lot. I have successfully applied the script and it is working fine. Can you help on this? If I want to apply the script for multiple tab on a same Google Sheet, what is the neccessary code changes needed?
@MarioBarretta
@MarioBarretta 8 месяцев назад
tried with more consecutives scripts with differents sheet name?
@neeshitdesai5164
@neeshitdesai5164 3 года назад
TypeError: Cannot read property 'range' of undefined onEdit @ Code.gs:14
@lucasstalmadison8747
@lucasstalmadison8747 3 года назад
same here 😭
@daniellefever5408
@daniellefever5408 3 года назад
I have same issue
@lucasstalmadison8747
@lucasstalmadison8747 3 года назад
ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VBzjyQYICNw.html it actually works, even tho you get error message, just do something in your sorting row and the function will kick in
@lucasstalmadison8747
@lucasstalmadison8747 3 года назад
@@daniellefever5408 thought it did'nt work but if you do a change in your row the function will begin! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-VBzjyQYICNw.html
@AxIIpro
@AxIIpro Год назад
Error TypeError: The comparison function must be either a function or undefined. Colaboración, por favor!
@homeswithjp
@homeswithjp 2 года назад
The function autoSort works when I ran but I can get the function onedit to work. I've done it over 10x. 🥺😢
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
I'd suggest taking time to learn how onEdit works first. This video should help ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-frAL7bJkU54.html
@jazarigaming
@jazarigaming 2 года назад
Mengapa Kalau saya input lewat google form datanya tidak otomatis mengurut sendiri ?
@WheelieTruther
@WheelieTruther 2 года назад
Is there a way to sort based on A - Z rather than ascending/descending?
@ExcelGoogleSheets
@ExcelGoogleSheets 2 года назад
A-Z is the same as ascending.
@WheelieTruther
@WheelieTruther 2 года назад
@@ExcelGoogleSheets Great!Thanks for the quick reply.
@fttx6673
@fttx6673 3 года назад
Thank you. Can you make an educational video on the data of two tables, the first contains the identifier and the country, for example, and the second table contains the identifier and the capital. There must be a way to make the identifier itself and merge it with the state and the capital. I have student data that I have their identifiers and emails and I have their grades in Another table I do not know to add emails. Did you understand what I mean can you help me
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
search for my VLOOKUP videos
@marlonmadrona1309
@marlonmadrona1309 3 года назад
​ @Learn Google Spreadsheets What if the column I want to sort is a formula?
@ExcelGoogleSheets
@ExcelGoogleSheets 3 года назад
Sorting it should be the same, but you need to choose a different trigger column to initiate sorting.
@mumtahina118
@mumtahina118 Год назад
@@ExcelGoogleSheets THANK YOU FOR THIS. I was literally so stumped as to why my code wouldn't make my google sheet automatically sort. I didn't realize that the formula in the column I picked as the trigger column was causing problems. This solved my hours on end searching for the solution.
@evanbahtera6902
@evanbahtera6902 2 года назад
I'm following all of your steps but still getting this error "TypeError: Cannot read property 'range' of undefined autoSort @ Code.gs:2". What did I missed? The tutorial is great and clear tho! My failure makes no sense XD
@nestorhernandez7494
@nestorhernandez7494 2 года назад
I had the same issue but here's what I figured out. Short answer: If you copied the code exactly how he has it at the end you did everything correct. Even though the range error code comes up just hit save and when you edit the spreadsheet it will work. Long Answer: The reason the error code comes up is because the whole script only gathers information from the spreadsheet when there is an edit made on the spreadsheet. When you hit "Run" to try and test it out you did not make any edits on the spreadsheet. So since no edit was made, the script does not gather any information and therefore doesn't know what the range is. I hope that made sense. I was in the same position as you but I just hit save and everything works as intended.
@crisarlsydneygaviola8920
@crisarlsydneygaviola8920 3 года назад
How to apply this to all sheets?
@enigma369org
@enigma369org 2 года назад
DUDE YOURE 🔥🔥🔥🔥🔥 THANK YOU!!!!