How to Automatically Sort Data in Google Sheets | Sort as You Type

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 พ.ย. 2024

ความคิดเห็น • 14

  • @rickestofricks5728
    @rickestofricks5728 2 หลายเดือนก่อน +1

    Thank you for spoon feeding this to me! I found a few other videos that explained what you was explaining however, i was struggling to wrap my head around it. Very helpful video.

  • @claireivy-d3p
    @claireivy-d3p 15 วันที่ผ่านมา

    This is soo amazing. Thanks for sharing this

  • @claireivy-d3p
    @claireivy-d3p 15 วันที่ผ่านมา

    Hi! amazing tutorials. Thanks. Can I ask if there's a way to have automatic arrangement? I have a CountA formula in my column B so that whenever I add new info on different sheets, it will show up in the summary or scoreboard. I noticed it doesn't automatically rearrange to descending or ascending unless I type a new number then it will arrange itself just like in your tutorial. Hope I explained my question clearly.
    Thank you so much. 🙏

  • @gabriellemoretti6174
    @gabriellemoretti6174 2 หลายเดือนก่อน +1

    This works perfectly! Thank you Chester.
    How do I modify the script to make the auto sort work in multiple tables in the same sheet and in multiple sheets of the same google sheets file?
    It would be very helpful as a lot of people would require this to work in multiple tables of the same sheet and other sheets in the same file..
    Please help :)

  • @mattcoysten8108
    @mattcoysten8108 25 วันที่ผ่านมา +1

    I can't seem to get it to sort when the sort column is formula... If I re copy the formula down the column the sort kicks in (I assume it's detecting that as the edit event rather than the formula simply updating based on edits elsewhere in the sheet).

  • @r3dbus
    @r3dbus 4 หลายเดือนก่อน +2

    Thank you, Sir. How to apply this for multiple sheets?

    • @chrisgodby7325
      @chrisgodby7325 3 หลายเดือนก่อน

      I have the same question.

    • @chrisgodby7325
      @chrisgodby7325 3 หลายเดือนก่อน +1

      I plugged this question and script into Chat GPT and got exactly what I needed for applying a sorting to multiple sheets:
      function onEdit(event) {
      // List of sheet names to apply the sorting to
      var sheetNames = ["FirstSheet", "AnotherSheet", "YetAnotherSheet"]; // Add the names of the sheets you want to include
      var c = event.range; // Get the cell that was edited
      // Column to sort by (e.g., column 1 for column A)
      var srtby = 1; // Change this to the position of the column you want to sort by
      // Range of cells that you want to sort (don't include the column headings)
      var t = "A3:DB24"; // Change this to the range of cells that you want to sort
      // Get the sheet where the edit happened
      var sheet = event.source.getActiveSheet();
      // Check if the edited sheet is in the list of sheets to apply sorting
      if (sheetNames.includes(sheet.getName())) {
      // If the edited column is the column we want to sort by
      if (c.getColumn() == srtby) {
      var range = sheet.getRange(t);
      range.sort({ column: srtby, ascending: true }); // Change to false if you want to sort in descending order
      }
      }
      }

    • @RakibHasan-vi4of
      @RakibHasan-vi4of 2 หลายเดือนก่อน

      @@chrisgodby7325 Did this work for you? I need the same thing but can't do it

  • @KELVINBARASA-f2e
    @KELVINBARASA-f2e 2 หลายเดือนก่อน +1

    JUST AN INQUIRY CAN THE ABOVE SCRIPT WORK ON AN IMPORTRANGE DATA

  • @marlizamabutas9036
    @marlizamabutas9036 2 หลายเดือนก่อน +1

    Hello! So I've been using the script for about a week now and at first it worked perfectly good. But now, it's kind of glitching. Like now, when I try to put a value in, it doesn't autosort anymore. I didn't change anything on the script or anything like that but it seems to have just stopped working. Do you have an idea of why that is?

  • @chrisgodby7325
    @chrisgodby7325 3 หลายเดือนก่อน +1

    I'm using this, but want to apply the sorting to 5 sheets (tabs) in the same project. Do i somehow apply the script 5 times, or is there a way to list multiple sheets on line 2 of the script?

  • @longmeadowparksrecreation8602
    @longmeadowparksrecreation8602 หลายเดือนก่อน +1

    I'm wondering how to use this to sort by one column and then another column...it doesn't look like this person replies to questions, though?

    • @beng290
      @beng290 วันที่ผ่านมา

      you need to copy and paste the final line of the code to above it, replacing "srtby" with the number of the column you want to sort by. inside the "if" statement add: "|| c.getColumn() == number" with the number being the number of column you sort by. you can repeat this how many times you'd like for every column to sort by, with the one with the least priority corresponding to the highest line of code.