This seems like a trivial question. But I have spent some times, I still cannot find any clues from the Internet. I have been trying the work-arounds. They all are not nice. Returning null
or undefined
will just result in a blank cell. Of course return "#N/A" (as a string) is far far far from good.
For instance, we have a function in Google App Script.
function GIVE_ME_NA() {
return NA(); // This won't work
}
And in cells A1 and A2
A1 =GIVE_ME_NA()
A2 =ISNA(A1)
The desired results showing in A1 and A2 are
A B
1 #N/A TRUE
In the sheet formula, we can simply use =NA()
. But in App Script, I cannot.