While Google Sheets does not support in-formula comments in the same way programming languages do, you can use the N() function in Google Sheets to include comments directly in your formulas.
The N() function in Google Sheets is designed to convert text values to 0 and will return any number you input as is. Since it ignores text values, you can use this feature to add comments within your formulas. Here's how:
=A1+B1+N("This is a comment")
In this formula, N("This is a comment") will be evaluated as 0, and therefore, it won't affect the calculation. It serves purely as a comment.
Note: These comments are not visible in the cell display but only in the formula bar when the cell is selected.
For more extensive documentation, consider using cell to add comments in a Google Sheets formula.
Right-click on the selected cell. Look for an option labeled "Insert note".
After clicking on "Insert note", a small text box will appear associated with the selected cell.
Type your comment or the additional information you want to include in this text box. There’s no character limit, so feel free to include as much detail as needed.
Once you’ve entered your note, you can click anywhere outside the note box to close it. The note is automatically saved.
We hope that this article has helped you and given you a better understanding of how to add comments in a Google Sheets formula. If you enjoyed this article, you might also like our articles on how to remove comments from Google Sheets and how to view comments in Google Sheets.