Value if it is not an empty string, otherwise a fallback value
=IF(value="",value_if_empty,value)Source: Benny Blue
This function is an equivalent to IFNA or IFERROR, but for blank arguments. It returns the first argument if it isn't blank or an empty string, and otherwise returns the second argument. If there's a chance that an input cell or partial formula will be undesirably empty or blank, use this function to provide a fallback value in that case. For example, if A2 is blank then =IFEMPTY(A2,0) returns "0", and if A2 contains "Hello" then =IFEMPTY(A2,0) returns "Hello". Just like IFNA or IFERROR provide the convenience of only needing to reference an argument once instead of pairing IF with ISNA or ISERROR, IFEMPTY offers that same convenience compared to using IF with an empty-string comparison.
Use the inputs below to create IFEMPTY as a reusable custom function in Google Sheets.
Learn how to add custom functions to Google SheetsIFEMPTY
Value if it is not an empty string, otherwise a fallback value
=IF(value="",value_if_empty,value)
value
value_if_empty
The value to return if it, itself, is not blank/an empty string
A2
The value the function returns if value is blank/an empty string
0
Other functions in the same category: Data Validation
Checks if a card number passes the Luhn (MOD 10) checksum
Checks whether a text value matches a basic email address format
Checks whether a text value is a valid IPv4 address
Checks whether a text value is a valid IPv6 address
Checks whether a text value is a valid ISBN-10
Checks whether a text value is a valid ISBN-13
Named functions enable the creation of custom, reusable formulas that mimic built-in functions, streamlining calculations and data manipulations. These functions simplify complex formulas, making spreadsheets more readable and less prone to errors. By encapsulating intricate logic within a single function call, they enhance consistency across your data. Utilizing named functions reduces the need to write lengthy formulas repeatedly, thereby improving workflow efficiency and productivity in data analysis and management.
Download and import — fastest way to add the function but does not include argument descriptions and examples
Follow these simple steps to download and import a function into your spreadsheet. This method is the quickest and easiest way to add the named function to your Google Sheets document, but will not include the argument description and examples.
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.
Copy and paste — copy and paste each property one at a time
Follow these simple steps to integrate a custom named function into your spreadsheet:
Once added, the function will be ready to use in your document like any other built-in function. Simply type the function name and provide the required inputs to use it in your calculations.