Google Sheets Apps Script - If, Then, Else If, Else JavaScript Statements Tutorial - Part 6
Вставка
- Опубліковано 11 жов 2024
- Video tutorial series about Apps Script (JavaScript) in Google Sheets (Excel VBA Equivalent).
In this tutorial we'll cover how to use If, Then, Else If, Else statements in Google Sheets scripts.
Google Sheets
www.google.com...
Website:
www.chicagocom...
Of all the tutorials I have seen, all the channels, you sir are truly a fine tutor. You explain things very nicely.
I have learnt the most from you
Thanks a lot!
Glad to hear that
@@ExcelGoogleSheets Is there a way by which UDF of one Sheet is available in another in same Google Account?
Some of the language wasn't functioning for me at first but it put me on the right track. Thanks!
Thanks for sharing your knowledge and expertise. I am learning so much from your video tutorials. I wish I could just work with you directly to complete some custom scripts for projects I am working on! These videos have been very helpful. Take care and all the best.
thanks !! you saved me!
simple and clear!!! exactly what i need to learn, and noone explain it good and simple like YOU!!
How can you use the If, else if to select different google docs templates based on an input from a cell. For example Option A selected in the cell populate template A, Option B selected populate template B. Love your videos, share them with colleagues when they're stuck
talented teacher
1:16 from 1h of tutorial binging the tutorialseries i most thankful for that sleight
SAME, mind blown when I saw this!
tag times
if = (começo) 4:00
else = 7:05
loop = (para iterar em um range) 8:10
loop = (atenção com a sintaxe "{}" usar a tabulação para evitar erros) 9:00
variável i = aplicando i na execução de if statements 10:17
else if = para ter mais teste lógicos 11:42
ordem dos if statements = (pensando a ordem das senteças) 14:22
múltiplos else if = 16:26
thanky you! please continue if you can I am loving this!
thank you so MUCH, this tutorial helped me a lot! Very clear explanation! well done
You're a very good teacher!
Thank you! 😃
Really helpful, thanks. What If I'd like to run a function when some criteria is met? I already have my function working, but I'd like to run it only when something is written in a specific cell.
You explain so nice sir. You should create a course on UDEMY
excelent
Got it sir no problem. I changed my else statement to else if. My for loop contained else ifs only
easy explanation
Very Helpful thank you so much!
🙏🏻
Thank you for your videos!. How could I get the selected item in a drop-down list in google form?
Thanks
Can you refer to a core function in a custom function?
is there a way to save a macro for it to be use on other worksheets. Something like excels' " personal "
Great tutorials bro keep it up, thank a lot I was going crazy trying to find this formula, made my day :) How can I apply math to the "if" function? like if the sum of two cells are greater than a X number then .....
Thanks in advance ,
It seems like you're looking for this ua-cam.com/video/hG5vKMb0Lpo/v-deo.html
Wow that was quick man thank you so its basically the same as you do on formulas?
regarding something else, Im watching all your app script playlist, but I still don't get the first section of the script regarding the- "var = SpreadsheetApp".... do I always do the same? can you maybe explain it with an example it will help a lot and thanks again keep it rolling you making great videos
If you're not a programmer it is hard to make sense of it, that's what we call instantiating an object & it's impossible to explain if you don't have some programming background. For simplicity, let's just say yes, it will always be the same. Basically you just name the Google Sheets program under that name you use after var and then you refer to it using that name,
thanks, yeah I'm sure its not that easy, but it makes sense more and more even from this answer thanks a lot for the help appreciate that :)
Are rows 3-4 only necessary when your function doesn't have a variable between the parentheses on line one?
Hi Sir... I did exactly what you did but I'm getting different results. It seems like my else statement doesn''t work. Everything works except my else statement. Please help. Thanks in advance.
i need to allow users to write to my sheet through a script but users should not be able to view/open the sheet manually.
the script needs to capture current user email.
is this possible ?
How to use if and function
For example
Column a:a is blank and column c:c is >0 so insert a new row in next column.
So please provide google script for this condition
Can u help me..
How to set password to individuals google sheet.
I m facing challenges in google sheet.
We have 4 users .
And I want to protect the sheets by password .
When user1 open the Google sheet and only one sheet show other sheet want to hide..
How to do that ????
Hey, thanks for the tutorial. Is there a way to work with arrays? For example If = workingCell = "Me" setValue "It's You!"
ua-cam.com/play/PLv9Pf9aNgemvD9NFa86_udt-NWh37efmD.html
if(approval == "Approved" && SalesNo != "") - Is this correct ? I took cell value In 'approval ' & 'SalesNo '
Hi, thanks for the awesome tutorial. However, I'd like to ask how we can implement two conditions, first is Column A must be checked. and Column G must be 100%.
I tried doing the following:
if (data[i][0] == true && data[i][8] == "100%"){
I'm not sure what I'm missing
your if statement is fine.
The question is how did you get you data?
Did you use getValues() or getDisplayValues()
Is it possible to hide the rows or columns in Google Sheets from a condition being executed by a Script?
Can you make script for timestamp that won't change when the data is updated > for 'created date' column; and timestamp for 'edited date' column. I need the format in dd-mmm-yyyy. Thank's
Why I can't Access the script editor, Can you help me sir? May be u have the solution,
How would you do an if function but it doesn't equal something? I thought it was != but something about my if function isnt working properly. Here it is priority and status are variables. if(priority != "" && status != "Complete","Delayed")
It is possible to set the if with two conditions to meet? For example, IF(x>10 and y>20) ?
if(x>10 && y>20)
@@ExcelGoogleSheets thank you!
Is there any code to execute countif function through script editor
Anyone happen to know how to use this with the previous "clear content" script video? For example. If cells in the range given contain "word" or"otherword" or "anotherword" then clearContent. Otherwise do nothing?
Take a look at isBlank in conjunction with an if, else
With all of these scripts reference locations, what happens if you add or remove a column or row? Traditional formulas update themselves. Do scripts?
No they don't.
what if they strings
How to close all sheets except the main sheet.
else do nothing. how can we do this?
I get this error: "You do not have permission to call..."
can you share the code please?
=IF(A6
I keep getting this error whenever I run:
TypeError: Cannot call method "getActiveSheet" of null. (line 4, file "Code")
This is my code:
function myFunction() {
var app = SpreadsheetApp;
var activeSheet = app.getActiveSpreadsheet().getActiveSheet();
var workingCell = activeSheet.getRange("B3:B1000").getValue();
if(workingCell >= 10){
activeSheet.getRange("C3:C1000").setValue("1st award");
}
}
.getValue(); only works with a single cell.You have to use .getValues() and then loop though it.Watch arrays and ranges video for better understanding, You need to watch at least first half of my videos in this series to be able to understand what to do here.
I received the same error regarding "getActiveSheet" of null... did you ever figure this out?
Figured it out... I'm an idiot. I needed to create the new script from the Spreadsheet (that wasn't absolutely clear to me from previous videos). I went into the spreadsheet: Tools>Script Editor and now it's fine.