How to add comment inside complex excel formula

前端 未结 3 1279
甜味超标
甜味超标 2021-01-03 22:20

Is it possible to add a comment within the cell of an excel formula? I have an exceedingly long expression inside a cell that could better understood if I can comment withi

相关标签:
3条回答
  • 2021-01-03 22:40

    For the problem Tom Sharpe mentions in the Answer by Ben Rhys-Lewis, there is a solution. Well, being Excel, probably five or six, but:

    For text functions you wish to append a comment to, use something like this:

    =CONCATENATE(IFERROR(A1/A2,""),T(N("comment")))
    

    N() will return a "0" which T() will then make into an Excel blank. It acts like "" in a formula in that it adds nothing to or into a string though it will not be a null if you paste values with it... an Excel "blank" is born.

    Note that it works with the math if the division does not result in an error because while Excel makes text out fo the result, in the cell, it uses it as a number for math done on that cell's text-number result (for instance, a text "3.5" will still add to a numerical 9.5 in another cell tha that adds 6 to the "3.5" in the cell).

    Also, to make the comments stand out, you can break the piece of your formula with Alt-Enter right before and right after that piece and its comment. Not like real commenting, but standing out more than some horrid muddle that it just increased stands out, enough worth doing and you can almost always add spaces before the comment as well:

    =function stuff function stuff
    CONCATENATE(IFERROR(A1/A2,""),    T(N("comment")))
    and a bit more function stuff and more and more and so on...
    
    0 讨论(0)
  • 2021-01-03 22:45

    Like this:

    =SUM(A1:A4)+N("This is a comment")
    

    http://www.howtogeek.com/162231/add-comments-to-formulas-and-cells-in-excel-2013/

    0 讨论(0)
  • 2021-01-03 22:55

    The N() comment function does not have to be the last portion of the function. So this is a workable solution:

    =+C6+N("description of C6 variable") +C7+N("C7 info") +C8+N("C8 info")

    While not required, for improved readability I use params to indicate the comment refers to several elements. For this example the first comment just refers to "q13" cell while the next two comments refer to the calculation between the "(...)"

    =+AA435 * q13+N(bonus multiplier) +(c435*$d$4/a435)+N("profit scaled by area") +(p24*$q$5 + w12*3)+N("blah...")

    I always prefer to break up long complex formulas into a single simple consolidation formula that adds together hidden columns of intermediate formulas.

    0 讨论(0)
提交回复
热议问题