copying empty cells, or not
John Denker via gnumeric-list <[email protected]> Wed, 3 Jun 2020 14:47:20 -0700
| Newsgroups | gmane.comp.gnome.apps.gnumeric |
|---|---|
| Message-ID | <[email protected]> |
Hi -- There are many situations where it is desirable to copy data from one region to another on the spreadsheet. This is particularly common when part of one sheet tracks part of another sheet. AFAICT, copying is nontrivial when the source contains empty cells. The simple "=" operator converts an empty cell into an explicit numerical zero, which is very often not what is desired. In particular, a great many functions including len(), count(), average() etc. treat zero very differently from empty. On possibility is to explicitly check if the source is empty, and if so to set the destination to the null string. =if(a1<>"",a1,"") This works for most purposes, although not for the type() function and not for comparison to zero using (...=0) or (...<>0). Question: Is there any way for a calculation to assign the "empty" status to a cell? Question: If not, is there a standard workaround? My practice has been to use the null string as a substitute for empty, and to never rely on the type() function or the zero-comparison operators without defensively checking the count() beforehand. Is there a better workaround? Is there a better way to think about these concepts? Is this documented somewhere? In particular, is there an authoritative list of which functions and operators we have to be defensive about?