@@ -14,7 +14,7 @@ This function is useful if you want to fill in missing data or consolidate data
| Returns the first non-null value from a list of values. | “bananas” |
<divclass='doc-toc'markdown=1>
-[Filling in empty or null rows](#filling-in-empty-or-null-values).
-[Filling in empty or null values](#filling-in-empty-or-null-values).
-[Consolidating values from different columns](#consolidating-values-from-different-columns).
-[Creating calculations across different columns](#creating-calculations-across-different-columns).
-[Accepted data types](#accepted-data-types).
...
...
@@ -110,12 +110,12 @@ FROM
If we assume that "Notes" is in column A, and "Comments" is in column B, we can achieve basic coalesce functionality by combining `IF` statements with functions like `ISBLANK` (for empty values) or `ISNA` (for "NaN" values).
Note that this formula doesn't generalize well if you're working with more than two columns. In those cases, you may be used to working with `INDEX` and `MATCH` in an array formula (or maybe considering [a move away from spreadsheets][spreadsheets-to-bi] entirely!).
```
=IF(ISBLANK($A2),$B2,IF(ISBLANK($B2),$A2,"No notes or comments."))
```
Note that this formula doesn't generalize well if you're working with more than two columns. In those cases, you may be used to working with `INDEX` and `MATCH` in an array formula (or maybe considering [a move away from spreadsheets][spreadsheets-to-bi] entirely!).
### Python
For those of you that come from the [pandas][pandas] and [numpy][numpy] world, let's assume our sample data is in a dataframe object called `df`.