Null
When a cell in Excel has not been populated, it contains no value. The Null() function returns an array with one element representing a missing value. Null() is therefore used by SubstituteArray() to populate empty cells with a specified value. In other words, Null() allows SubstituteArray() to recognise unpopulated cells in Excel.
Syntax
Null ()
Example. Recognising and replacing empty cells
The SubstituteArray() function is first used to replace any empty cells with the word ‘Weekend’. This function looks for empty strings (“”). Because the blank cells contain no values (are not empty strings), the function does not work. The second SubstituteArray() function looks for null values when making replacements. This function works because Null() allows it to recognise the blank cells.
AGL | Close Price | Close Price – substitute “” | Close Price – substitute Null values | Replacement Value |
01 April 2015 | 25604 | =SubstituteArray(B2:B9,E2,””) | =SubstituteArray(B2:B9,E2,Null()) | Weekend |
02 April 2015 | 24970 | |||
03 April 2015 | 25369 | |||
04 April 2015 | ||||
05 April 2015 | ||||
06 April 2015 | 24684 | |||
07 April 2015 | 25402 | |||
08 April 2015 | 25639 |
AGL | Close Price | Incorrect output | Correct output | Replacement Value |
01 April 2015 | 25604 | 25604 | 25604 | Weekend |
02 April 2015 | 24970 | 24970 | 24970 | |
03 April 2015 | 25369 | 25369 | 25369 | |
04 April 2015 | Weekend | |||
05 April 2015 | Weekend | |||
06 April 2015 | 24684 | 24684 | 24684 | |
07 April 2015 | 25402 | 25402 | 25402 | |
08 April 2015 | 25639 | 25639 | 25639 |