When formulas show unintended results or errors, it can be very frustrating, especially if you don’t know what to do next.

A number of things can be wrong. For example, there might be mismatched parentheses, typing mistakes, or references to data in ranges that don't exist. The following best practices can help you prevent or resolve common mistakes when you build or need to correct your formulas.

Use this best practice: |
To avoid this common mistake: |

Start every function with an equal sign (=) |
If your entry doesn’t start with an equal sign, it isn’t a formula and won’t be calculated—a common mistake that’s easy to make. For example, when you type something like To avoid these unexpected results, always start with an equal sign. For example, type: |

Match all opening and closing parentheses |
Make sure that all parentheses are part of a matching pair. In a formula that uses a function, each opening parenthesis needs a closing parenthesis for the function to work correctly. For example, the formula The correct formula would look like this: |

Enter all required arguments |
Most functions have required arguments—values you need to provide for the function to work. Only a few functions (such as PI or TODAY) take no arguments. Check the formula syntax that appears when you start typing an equal sign followed by a function to make sure you enter all required arguments—no more and no less. For example, the UPPER function accepts only one string of text or cell reference as its argument: =UPPER("hello") or =UPPER(C2) Also, some functions, such as SUM, require numerical arguments only, while other functions, such as REPLACE, require a text value for at least one of their arguments. If you use the wrong data type, some functions might return unexpected results or show a #VALUE! error. |

Use unformatted numbers in formulas |
Don't enter numbers formatted with dollar signs ($) or decimal separators (,) in formulas, because dollar signs indicate absolute references and commas are argument separators. Formatted numbers aren’t used in the formula calculation. Instead of entering If you use formatted numbers in arguments, you’ll get unexpected calculation results, but you may also see the #NUM! error. For example, if you enter the formula You can format the formula result with decimal separators and currency symbols |

Use the right cell data type |
Your formula might not return expected results if the cell’s data type can’t be used in calculations. For example, if you enter a simple formula =2+3 in a cell that’s formatted as text, Excel Online can’t calculate the data you entered. All you'll see in the cell is To fix this, change the cell’s data type from -
Select the cell. -
Click **Home**>**Number Format**arrow, and pick**General**. -
Press F2 to put the cell into Edit mode, and press Enter to accept the formula.
A date you enter in a cell that has the Number data type might be shown as a numeric date value instead of a date. To show this number as a date, pick a |

Use the * symbol to multiply numbers |
You may want to use x as the multiplication operator in a formula, but you need to use the asterisk (*) instead. When you use an x in your formula, Excel Online can’t calculate the result and shows the formula in the cell instead, placing a dotted red border around the cell to let you know there’s a formula error. |

Use quotation marks around text in formulas |
If you create a formula that includes text, enclose the text in quotation marks. For example, the formula In the formula, "Today is " has a space before the ending quotation mark to provide the blank space you want between the words |

Don’t nest more than 64 functions in a formula |
You can combine (or nest) up to 64 levels of functions within a formula. For example, the formula |

Avoid dividing numeric values by zero |
Dividing a cell by another cell that has zero (0) or no value results in a #DIV/0! error. To avoid this error, nest your division operation inside the IFERROR function. For example, enter the following two formulas in cells in a worksheet: =IFERROR(3/0,0) =IFERROR(3/7,0) The first formula returns 0 because the IFERROR function recognizes that dividing by zero results in an error. The second formula returns the value of 3/7—there’s no error because you're not dividing by zero. |

To make it easier to create your formulas, you may also want to learn about these formula tips and tricks.