# How can I remove the #DIV/0! Error or a "0" from a formula in a LabTutor Table Panel?

The Table Panel in LabAuthor is used to display values and to perform calculations in LabTutor Experiments. Cells with a white background are editable by Students, either manually or by dragging values from a Value Panel. Cells with a shaded background are read-only, usually for displaying labels or displaying calculations. Cells with an orange background indicate cells containing a formula.
Calculations follow the known Microsoft Excel formula syntax, such as =A2/B2. However, empty cells like A2 and B2 are handled as a "0", hence the calculation results in a 'division by zero' (#DIV/0!) error. If cell C2 holds the formula =A2+B2, C2 will display a zero (0). To avoid displaying #DIV/0!, use the following functions:

The formula =A2/B2 produces the #DIV/0! error:
Use =IF(B2=0,"",A2/B2) to return an empty string, or =IF(B2=0,0,A2/B2) to return 0.
The formula =AVERAGE(B2:B4) produces a zero (0):
Use =IF(COUNT(B2:B4),(AVERAGE(B2:B4)),"") to return an empty string until one value in the range B2:B4 has been entered.
The formula =AVERAGE(B2,B4,B6) produces a zero (0):
Use =IF(AND(B2="",B4="",B6=""),(AVERAGE(B2,B4,B6)),"") to return an empty string until one value in B2, B4 or B6 has been entered.
The formula =AVERAGE(B2:B4) produces a zero (0):
Use =IF(OR(B2="",B3="",B4=""),"",AVERAGE(B2:B4)) to return an empty string until all values in the range B2:B4 have been entered.
-----
Note: for Mainland European language settings, replace the comma (,) with a semicolon (;).