google-sheetsspreadsheet

In Google sheets, how does one either return a blank cell or perform a function based on another cells lack of content?


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 :)


Solution

  • You need to add arrayformula around it - and swap where your empty string is - without seeing the data essentially what you want is:

    =arrayformula(if(ISBLANK(A:A),"",A:A+TIME(2, 0, 0)))