Default value for numerical cells

I’m trying to create a reusable generic formula to use in numerical cells to give them a default value.

I am stuck.

I tried
=IF(ISBLANK(), 0, NEED CURRENT CELL VALUE HERE)

Basically if the cell is empty I want the default value to be 0 otherwise, the numerical value of the cell.

I do not want to use the cell numbers in the formula so it is generic and easily applied to various cells throughout my spreadsheet.

Thanks

Which cell you want to reference in the function ISBLANK? If the referenced cell contains a formula - even if the result of the formula is an empty string “” - then the cell is NOT blank.

1 Like

An empty cell is different to a cell containing 0.

Wouldn’t the simplest way way be to enter 0 in a cell, copy the cell and paste the zero value into the range of cells that you want to have 0 in?

Please note that basically, cell content in a spreadsheet is “atomic”. A cell can contain max one entity. The entity may be a number, a text string, or a formula.

Do you want your formula to “sit and wait”, allowing entry in its cell, and whenever content is deleted, a zero (or other default number) is (re)applied? You can’t do that in a straightforward manner in a spreadsheet.

If you want to use a default value in a formula whenever an empty cell is referenced, that is fairly straightforward. You already posted the formula template:
=IF(ISBLANK(source address), default, source address)

The default may be a constant value (number or text) or a reference to a cell holding the default value (facilitating easy alteration of the default across your spreadsheet).

The sign „0“ has 3 difference notations:

  • boolean NULL = logical “FALSE”,
  • arithmetrically NULL = math. operand (physical value) and
  • meaning NULL = empty cell.

Otherwise if you see an empty cell, it can be inherented the unvisible space character “ ". Instead of any unused empty cell in an area or matrix you shoud set a visible character like “–” or “?”.

The boolean request of a cell which is empty or not empty can be:

  • =NOT(A1<>"") as empty,
  • =(A1="") as empty,
  • =(A1="–") as non-distributed.