Exceljet

Quick, clean, and to the point

Leave a comment in a formula

Excel formula: Leave a comment in a formula
Generic formula 
=formula+N("comment")
Explanation 

To leave a comment in a formula that returns a numeric result, you can use the N function. In the example shown, the formula in F9 is:

=SUM(F5:F8)+N("Q4 numbers are estimates")

How this formula works

This is a tricky use of N() that allows you to use it as a way to leave in-cell comments. It only works for formulas that return numeric results.

The N function takes a value and returns a number. When given a text value, the N function returns zero.

In this case, the primary formula the SUM function, and the N function simply evaluates the comment text and returns zero: 

=SUM(F5:F8)+N("Q4 numbers are estimates")
=SUM(F5:F8) + 0
=410,750

The comment is visible in the formula bar when the cell is selected.

Author 
Dave Bruns

Excel Formula Training

Formulas are the key to getting things done in Excel. In this accelerated training, you'll learn how to use formulas to manipulate text, work with dates and times, lookup values with VLOOKUP and INDEX & MATCH, count and sum with criteria, dynamically rank values, and create dynamic ranges. You'll also learn how to troubleshoot, trace errors, and fix problems. Instant access. See details here.