Google Sheets QUERY by dates
9:17
Пікірлер
@ajduke
@ajduke 2 сағат бұрын
Is there a way to get this to trigger when the sheet is being updated via an API call and not a human editing it?
@petalsray2235
@petalsray2235 3 сағат бұрын
By any chance you also have videos done for managing & editing tables in Google Doc? someone passed me a Doc with a detailed timetable that is very difficult to edit.
@nischaltam
@nischaltam 14 сағат бұрын
Thank you
@Seandyyyu
@Seandyyyu 2 күн бұрын
Thank you for your helpful video. Though I have a question. Is it possible to copy and paste data to specific locations inside a tab based on a criteria (by month)? For example, I would only want to get the data within a specific month and paste it inside a tab wherever I want, is that possible?
@yagisanatode
@yagisanatode Күн бұрын
Yes you can!
@jarydc7024
@jarydc7024 4 күн бұрын
I know this older so sorry if it’s been resolved elsewhere, but shouldn’t we have plugged deck into the formula after copying in the query?
@EmailShot
@EmailShot 7 күн бұрын
Great walkthrough!
@AlAqsaRetoWijaya
@AlAqsaRetoWijaya 14 күн бұрын
Hey, is it possible to put an image in a sheet? I'm stuck for 2 days now... I have a google form that accepts image upload. the responses is saved to a spreadsheet. I wish to put that image in my sheet that I newly created using apps script
@SuperAdmin-c3m
@SuperAdmin-c3m 14 күн бұрын
Chips and Multi-Select is now available. I am looking for a apps script to set a data validation rule as well as the chips and multi-select format. Maybe an inspiration for an upcoming video ;)
@yagisanatode
@yagisanatode 14 күн бұрын
If only Google updated the API inline with the UI release.
@SuperAdmin-c3m
@SuperAdmin-c3m 14 күн бұрын
@@yagisanatode Indeed. I opened a feature request. Until this happens I use a workaround to get what I need: SpreadsheetApp.getActiveSpreadsheet().getRangeByName(namedRangeTemplateCell).copyTo(sheet.getRange(rowIndex, headerMap["targetColName"]), SpreadsheetApp.CopyPasteType.PASTE_DATA_VALIDATION, false);
@yagisanatode
@yagisanatode 14 күн бұрын
While your at the Google Issue Tracker consider give this one on People Chips a +1 : issuetracker.google.com/issues/227926015
@The_Survivorr
@The_Survivorr 15 күн бұрын
One hell of a way to play eaglercraft in school after they blocked it
@andhikamrk7633
@andhikamrk7633 16 күн бұрын
thank you very much, this help me. this method has similiar result as TAKE function in excel, since Google sheet doesn't have it.
@animebinge5867
@animebinge5867 20 күн бұрын
const date = new Date(); const data = [date, ...sourceVals]; On this part, what if I only want to get the date value and exclude the time GMT and other stuff?
@yagisanatode
@yagisanatode 19 күн бұрын
I would set the Format > Number > Custom date and time in Google Sheets. Alternatively, you could look at the JavaScript docs on getDate() getMonth() getYear() then generate a new Date with just these values. If you want to display the date as a text string with toDateString(). Give it a crack!
@animebinge5867
@animebinge5867 19 күн бұрын
@@yagisanatode Thank you for the response. I will try your suggestions. I have another question, I am on this part of your tutorial. //Validate if all cells are filled const anyEmptyCell = sourceVals.findIndex(cell => cell == ""); if(anyEmptyCell !== -1){ const ui = SpreadsheetApp.getUi(); ui.alert( "Input Incomplete", "Please enter a value in ALL input cells before submitting", ui.ButtonSet.OK ); I have a cell that can have a value of 0. On Data validation it allows 0 or more but after I click the button it prompts the missing warning since the value of that cell is 0. Does the 0 not counted as a value ?
@yagisanatode
@yagisanatode 19 күн бұрын
This is due to how equality works in JavaScript. Because I didn't want zero distance, I knew that any zero will be considered false in the same way an empty string would also be considered falsy. The double equals comparison (==) is called loose equality. If you want a string one-for-one comparison, you can use the triple equals (===) Give this little test code a run to better see how they work: ``` function test_zeroAsEmpty(){ console.log("Single value: (0 to '' compare)", " Double equals type conversion:", 0 == "", " Triple equals type conversion:", 0 === "") const sampleArray = [ 'EV002', 0, 0.01, "" ] const findRespDbl = sampleArray.findIndex(cell => cell =="") console.log(`Find in array double equals ${sampleArray}`, "Position:",findRespDbl) const findRespTpl = sampleArray.findIndex(cell => cell ==="") console.log(`Find in array double equals ${sampleArray}`, "Position:",findRespTpl) } ``` More on Equality comparison and sameness: developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness
@vickimrjv2314
@vickimrjv2314 22 күн бұрын
Is it possible to ignore empty rows ..? The data is in 5 to 30 but I selected it till the end as more data will be added daily. And I have a certain situation where I want this formula to dynamically give the last row on top as the data is added regularly.
@yagisanatode
@yagisanatode 22 күн бұрын
You could filter out blanks using the FILTER function, but I think you are looking to add data from the top down, do this Google Apps Script approach might be more useful for you. kzbin.info/www/bejne/bKHYmH-uYrSFi5Y
@vickimrjv2314
@vickimrjv2314 22 күн бұрын
@yagisanatode I have tried adding filter function , either I made an error or the formula is not working
@vickimrjv2314
@vickimrjv2314 22 күн бұрын
@yagisanatode =Sort(Ratios!C5:H66, Row(Ratios!C5:H66), FALSE) This is the formula I am using for now, it is giving the last row on the very top of the result. But so for my data is around row 31, the rest are empty for now. I am using manual filter over the result to filter empty rows... I want to be done automatically
@yagisanatode
@yagisanatode 21 күн бұрын
* Edit. This response contained errors. This is the correct approach: QUERY will be your best approach for a range that has more than one column. =QUERY(SORT(Ratios!C5:H66,ROW(Ratios!C5:H66), FALSE), "SELECT * WHERE Col1 is not null")
@vickimrjv2314
@vickimrjv2314 21 күн бұрын
I tried the first formula, but got the error which says Filters Range must be a Single row or a Single Column..
@AlAqsaRetoWijaya
@AlAqsaRetoWijaya 23 күн бұрын
Is it possible to copy a tab to a new spreadsheet?
@yagisanatode
@yagisanatode 22 күн бұрын
Yes. Use `const ssNew = SpreadsheetApp.create("My new sheet");` then reference `ssNew` when copying the tab over. Check out the link to the playlist in the description on how to copy sheet tabs.
@AndrewRMoloCPA
@AndrewRMoloCPA 26 күн бұрын
Thanks for Sharing! only problem is the script takes more than a minute to run. any solutions to this?
@yagisanatode
@yagisanatode 26 күн бұрын
That depends on the type and size of data you are appending and how you are retrieving the data.
@AndrewRMoloCPA
@AndrewRMoloCPA 19 күн бұрын
@@yagisanatode Thank you so much. all I had to do was remove all formatting from the source and destination sheets and it went down to 4 seconds!
@yagisanatode
@yagisanatode 19 күн бұрын
Great to hear.
@leighaheath9262
@leighaheath9262 27 күн бұрын
Product link says no longer available :(
@yagisanatode
@yagisanatode 26 күн бұрын
Thanks for letting me know. This is a weird one. The checkout page works directly from the link but when you click it from the main page it doesn't 🤔. I've sent a message to Teachable about this to see what they can do. checkout.teachable.com/secure/925477/checkout/order_d247xb29
@maxtanariyakul1403
@maxtanariyakul1403 28 күн бұрын
Went back here several times to copy the formula. Never have a chance to say thank you. Thank you!
@yagisanatode
@yagisanatode 28 күн бұрын
Wonderful to hear. Thank you.
@flatlandryan
@flatlandryan 29 күн бұрын
Is there anyway possible to do this, but allowing you to delete the previous NON reverse rows? I have a spreadsheet with like 500 I need to flip, for taxes, but I can't delete the original non-reversed, because if I do, it deletes the reversed one...
@yagisanatode
@yagisanatode 28 күн бұрын
Two approaches here. 1. If you only need the data and no underlying formulas, you could select the flipped range and copy it (ctrl c), then paste (ctrl shift v) over it as values. 2. With a Google Apps Script macro, you could copy the values and reverse the column or row with the `reverse()` method, then set it in the location that you need.
@naungsai
@naungsai 29 күн бұрын
How about the lookup column is with arrayformula?
@yagisanatode
@yagisanatode 28 күн бұрын
Hey there. I am not 100% sure what you are asking for here.
@dpfastner
@dpfastner Ай бұрын
I was wondering if there is a way to search a range for a specific text value and then return the background color and font color of that cell. For example, If I wanted to search the range A3:A12 for the text "Spirit Island" and then fill in cell C1 with the background color and font color of the cell that "Spirit Island" occupies would that be possible?
@yagisanatode
@yagisanatode Ай бұрын
Yes. Have a look at my series on find and replace here: kzbin.info/aero/PLSDEbLgMgqvo8LJmCbgjBOgmXBVS7tAKY With a bit of experimentation, you should be able to combine what you have learned from this tutorial with the Find and Replace tutorials to get what you need. Happy coding! 🐐
@PatchedBandit
@PatchedBandit Ай бұрын
Excellent info! Can't understand why google makes this so difficult.
@BraveHeart-ht8zf
@BraveHeart-ht8zf Ай бұрын
Please tutorial sidebar with edit, Sir
@yagisanatode
@yagisanatode Ай бұрын
I'm not sure what you are asking for here, mate.
@prokashyap
@prokashyap Ай бұрын
Will it work with audio also ?
@yagisanatode
@yagisanatode Ай бұрын
Give it a try. 👍
@francisallotey7164
@francisallotey7164 Ай бұрын
The tutorial does not work on the parent folder it works on the child only is there a reason. I get folder not found error on the parent but when i use a child folder ID it works.
@yagisanatode
@yagisanatode Ай бұрын
Check out the written version of the tutorial from the link in the description. This should answer most questions.
@OrganistaAndrzej
@OrganistaAndrzej Ай бұрын
I would like to show this result in full days and hours by full days. How do I do that?
@yagisanatode
@yagisanatode Ай бұрын
What have you tried so far?
@Yourfavoritementor
@Yourfavoritementor Ай бұрын
First off, amazing video and instruction! Thank you! I struggled on finding this solution for close to 3 hours, shame on me. lol However, I am wondering if you know how to add an additional criteria on using the filter formula on DTS and say those pupils listed have a grade school number listed, how could I go about separating them by grade as well? Thanks in advance!!
@yagisanatode
@yagisanatode Ай бұрын
Thanks for the kind words. You can filter out blank rows with `[grade_school-Number-range]<>""`. So you can this to the filter.
@JeanaHerring
@JeanaHerring Ай бұрын
Thank you! You made this super easy for me!
@yagisanatode
@yagisanatode Ай бұрын
Glad I could help!
@karan080891
@karan080891 Ай бұрын
Wonderful. Helped me a lot.
@yagisanatode
@yagisanatode Ай бұрын
Glad it helped!
@jenniferblanchard494
@jenniferblanchard494 Ай бұрын
My message is saying TypeError: ss.getSheets is not a function Please help
@yagisanatode
@yagisanatode Ай бұрын
What does your `const ss` variable look like?
@bakkajua
@bakkajua Ай бұрын
Does this work for Mobile?
@yagisanatode
@yagisanatode Ай бұрын
Hey there, you can't use buttons and AppScript-generated menu items on the mobile app, unforunately. One workaround is to trigger your script from a checkbox.
@LyanneDiaz-x9e
@LyanneDiaz-x9e Ай бұрын
Amazing. Thank you. It worked!
@yagisanatode
@yagisanatode Ай бұрын
You're welcome!
@walterkovacs2612
@walterkovacs2612 Ай бұрын
shit video doesn't explain how to make it add values.
@PinsewCreatives-y4z
@PinsewCreatives-y4z Ай бұрын
Hello!! Is there a way that the button also works on mobile version?
@yagisanatode
@yagisanatode Ай бұрын
Unfortunately, not with the mobile app. You can, however, user a checkbox to do the same. Here are two examples of checkboxes and the onEdit() simple trigger in action: yagisanatode.com/google-apps-script-create-a-select-all-checkbox-to-tick-checkboxes-in-any-desired-range-in-google-sheets/ yagisanatode.com/add-the-editors-email-when-they-tick-the-check-box-in-google-sheets-with-apps-script/
@SALOMONGREEN-q7t
@SALOMONGREEN-q7t Ай бұрын
Excellent - Thank you for sharing.
@dwinix1658
@dwinix1658 Ай бұрын
How about protecting google sheet to prevent adding or in insertion or deleting of "rows" ?
@yagisanatode
@yagisanatode Ай бұрын
I cover this here: kzbin.info/www/bejne/oX6WimSQftZmjNU This tutorial is more for editors who wish to allow some edits to a tab, but prevent users from moving certain columns or rows.
@krashanpriyadharshan6293
@krashanpriyadharshan6293 Ай бұрын
This is so useful. Thank yous so much, also could you please kindly direct me to move those selected rows to another sheet?
@yagisanatode
@yagisanatode Ай бұрын
You can check out this playlist for moving data in Google Sheets with Apps Script: kzbin.info/aero/PLSDEbLgMgqvqP0GQkiYOsH71yUeWBUi-Q
@krashanpriyadharshan6293
@krashanpriyadharshan6293 Ай бұрын
@@yagisanatode Thank you!
@Manikanta-fn9ig
@Manikanta-fn9ig Ай бұрын
thanks a lot.. all are valuable videos now a days.
@guyinsandiego7257
@guyinsandiego7257 Ай бұрын
Great information presented in a clear concise manner. One update though, in the Excel version included in Office 365 the "Arrayformula", that is first referenced at the 6 minute mark, is assumed and so you can omit this from the formula which leaves you with =(SEQUENCE(60*24,1,0,1) *1/(60*24)). Thank you for the great tutorial!
@yagisanatode
@yagisanatode Ай бұрын
Thanks for the kind words. This is a Google Sheets tutorial, but good to know about MS Office 365.
@chiefscout
@chiefscout 2 ай бұрын
So visually this works, however I need an actual empty cell because my spreadsheet uses a Google Function b=GOOGLEFINANCE(B28&":"&"SDY", "name"). The B28 is the exchange on which the security is listed. However certain named securities don't have an exchange and so the B28 cell as above must be blank. After playing around it seems the single quote works in my case.
@Saveturtlessavetheplanet
@Saveturtlessavetheplanet 2 ай бұрын
This was my first time using App Script ever and it worked perfectly. Thank you so much for the great tutorial!!! Lifesaver
@yagisanatode
@yagisanatode 2 ай бұрын
Fantastic to hear! Happy coding!
@JessicaBassey-u3u
@JessicaBassey-u3u 2 ай бұрын
is it possible to do this without making a new table
@yagisanatode
@yagisanatode 2 ай бұрын
Sure, you could create an array of column values within the formulas and then reverse that range. I'm curious, how would you use this?
@JessicaBassey-u3u
@JessicaBassey-u3u 2 ай бұрын
@@yagisanatode haha no i just messes up the format of the spreadsheet and water to rearrange it without making another table
@lAdammpl
@lAdammpl 2 ай бұрын
Awesome video on the google sheet that you shared i noticed that you get 18.18 for the calculated gst (this is for the amount of $200) and im getting flat $18. Without the cents and is the same code, any idea why that happens?
@yagisanatode
@yagisanatode 2 ай бұрын
In the menu bar, you will see `.0` icons. One to increase decimal places and one to decrease decimal places. Try increasing decimal places to see if the value appears.
@PARKERSHAW
@PARKERSHAW 2 ай бұрын
Is there any way to have one person report to several people? I haven't found a workaround for this... It seems like many people can report to one manager, but one person is not allowed to report to more than one person... Thanks
@yagisanatode
@yagisanatode 2 ай бұрын
Unfortunately, not with the Google Sheets chart. Your best bet here is to roll your own with Google Drawing and embed it into your sheet or use Google Slides.
@SiarlWard
@SiarlWard 2 ай бұрын
helpful, thanks!
@BrandonGoodwin-y5h
@BrandonGoodwin-y5h 2 ай бұрын
I need help please. I am needing to add code to the existing macro in this file. The new code should perform a Find & Replace on the entire columns of R, W, and AB. It should Find "PAY" (match Case and Entire Cell Contents) and Replace with "Paid". This new Find & Replace code should run before the existing macro code runs. docs.google.com/spreadsheets/d/1igKtYmkVo3wVaGF9E1RBTkikSMyp8aneMUQRN8ZOWOM/edit?usp=drivesdk
@cathymartin3379
@cathymartin3379 2 ай бұрын
I cannot get this to work to reverse a block of rows/columns as in your first example, I keep getting a value error, not sure what I'm doing wrong.
@yagisanatode
@yagisanatode 2 ай бұрын
It's difficult to understand what is causing your issue without seeing what your formula looks like.
@kznatty
@kznatty 2 ай бұрын
This worked great but there is a black line underneath the image (I am assuming Google showing users this is a linked image), is there a way to remove this, is this something new they have introduced or have I done something wrong here?
@yagisanatode
@yagisanatode 2 ай бұрын
Hmm, that doesn't typically occur for me. It could be browser based perhaps. Maybe something like safari might do this 🤷‍♂️. You could try changing the font color to match the background.
@kznatty
@kznatty 2 ай бұрын
@@yagisanatode using Chrome version 129.0.6668.71 on a MacBook and even changing the font colour to match the background does not remove it. I am using the HYPERLINK method and no matter what image I use it adds it annoyingly.
@dannysoda1
@dannysoda1 2 ай бұрын
Thanks again for these videos, works great!
@yagisanatode
@yagisanatode 2 ай бұрын
Great to hear!
@dannysoda1
@dannysoda1 2 ай бұрын
@@yagisanatode I have noticed that the script takes a long time (sometimes up to a minute) when you have over a few hundred rows already filled in your destination sheet. I am using the binary method as well which I figured would be faster. Is there something that I can do to speed this up?
@yagisanatode
@yagisanatode 2 ай бұрын
@@dannysoda1 Hmm, it should't be taking that long to process. Are you drawing data from multiple locations or adding a single row at a time? Appending a range of rows will be much more peformant and if you need to collect data from multiple locations in your Spreadsheet then something like getRangeList() might be more efficient.
@dannysoda1
@dannysoda1 2 ай бұрын
@@yagisanatode I am drawing data from one tab and appending in one other tab. I am using a range of columns A2:N in the source tab and appending B:0 in the destination tab. Not really sure why its hanging up. I just deleted everything from the destination tab to try from scratch and its just as slow with a clean slate. Just looking through my executions the times range from about 3.5seconds to about 255seconds. Not sure why.
@yagisanatode
@yagisanatode 2 ай бұрын
@@dannysoda1 Hmm. The data that you are drawing from, are you retrieving a single range of data, for example the last 5 rows, or are you drawing from multiple rows within the range? Whend you are appending the data, are you appending a range or a single row each time?
@eliasrabanales5587
@eliasrabanales5587 2 ай бұрын
Hi Scott, by Aby chance do you know How to Schedule a message to be sent Every day at 6:00 am, this in order to send Threads every day in a Space chat
@yagisanatode
@yagisanatode 2 ай бұрын
You're looking at cron jobs or cloud equivalents here. Sticking with the language used in this video, you can set up a clock trigger using the Google Apps Script trigger menu or programmatically using the API. kzbin.info/www/bejne/g5q6l5R5g7etqaM developers.google.com/apps-script/reference/script/clock-trigger-builder
@flanut
@flanut 2 ай бұрын
Thats a PERFECT asnwer!!! thanks!
@yagisanatode
@yagisanatode 2 ай бұрын
Great to hear.
@dannysoda1
@dannysoda1 2 ай бұрын
Works great but what if you want to be able to keep pasting this range to the next available row below the pasted data in the destination sheet? So in other words the destination sheet becomes an archive. Hope this makes sense.
@yagisanatode
@yagisanatode 2 ай бұрын
Check out my series on this here: kzbin.info/aero/PLSDEbLgMgqvre1M8SpQd7SR9V7Dn9M2H_&si=974__RZjE1DzKSoT