This is what I have thus far:
=if(ISBLANK(A:A), (A:A+TIME(2, 0, 0)), "")
I'd like the script to add 2 hours to A:A or just remain blank if there is no data inside A:A
Any ideas would be greatly appreciated. Thank you :)
Using the IF Function The IF function can be used on its own in a single logical test, or you can nest multiple IF statements into a single formula for more complex tests. To start, open your Google Sheets spreadsheet and then type =IF(test, value_if_true, value_if_false) into a cell.
Keep cell blank until data entered in Select first cell that you want to place the calculated result, type this formula =IF(OR(ISBLANK(A2),ISBLANK(B2)), "", A2-B2), and drag fill handle down to apply this formula to the cells you need.
If you want to end up with a truly 'blank' value, you can use the expression IFERROR(0/0)
. This is different from an empty string which is what you get when you use ""
. A cell with an empty string will not test true using ISBLANK()
, but IFERROR(0/0)
will.
For example:
=IF(ISBLANK(A1),IFERROR(0/0),"not blank")
How this works: The IFERROR
function takes two arguments. If the first argument is a value, IFERROR
returns that value. If the first argument returns an error, IFERROR
returns its second argument - but if there is no second argument, it returns blank. We use the expression 0/0
to deliberately force an error by dividing by zero, and because there's no second argument IFERROR
returns blank.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With