Home > e-infrastructure, office-software > A little addendum about data types to the +N(“comment”) in-cell formula comment trick in Excel

A little addendum about data types to the +N(“comment”) in-cell formula comment trick in Excel

    1. You are relying with this well-documented trick on the fact that addition of 0 will altering a numeric value.
    2. However, what is not mentioned: not all work in Excel involves the number data type.
      1. Try adding your comment or zero to a string data type, and you will get a #VALUE error.
      2. Boolean, however, works also, since – as you can see when you have Excel evaluate your formula – if  you try adding 0 to a Boolean data type, Excel casts the prior Boolean FALSE to 0 or TRUE to 1, and casts the result of your addition (of 0 = nothing) back to the same initial Boolean for further evaluation. excel-evaluate-fromula-w-n-comment boolean
      3. So just put your +N()-comments in those part of your formula that involve either number or Boolean data type, and avoid adding to strings, for example:

=IF(
    OR(
        ISBLANK(
            [Related issues]
        ),
        (            ISERR(
                FIND(
                    #,
                    [Related issues]
                )
            ) )
    ) +
    N(
        do nothing if no related task in col:related issues
    ),
    ,
    IF(
        NOT(
            ISERR(
                FIND(
                    ,,
                    [Related issues]
                )
            )
        ) +
        N(
            do nothing if no 2nd value in col:related issues
        ),
        CONCATENATE(
            MID(
                MID(
                    [Related issues],
                    FIND(
                        ,,
                        [Related issues]
                    ) + 2,
                    LEN(
                        [Related issues]
                    ) 
                    FIND(
                        ,,
                        [Related issues]
                    ) + 1 +
                    N(
                        extracted the 2nd value from col:related issues
                    )
                ),
                FIND(
                    #,
                    MID(
                        [Related issues],
                        FIND(
                            ,,
                            [Related issues]
                        ) + 2,
                        LEN(
                            [Related issues]
                        ) 
                        FIND(
                            ,,
                            [Related issues]
                        ) + 1
                    )
                ) + 1,
                4
            ) +
            N(
                extracted the 4# of id of related issue
            ),
            MID(
                MID(
                    [Relatedissues],
                    FIND(
                        ,,
                        [Relatedissues]
                    ) + 2,
                    LEN(
                        [Relatedissues]
                    ) 
                    FIND(
                        ,,
                        [Relatedissues]
                    ) + 1
                ),
                FIND(
                     ,
                    MID(
                        [Related issues],
                        FIND(
                            ,,
                            [Related issues]
                        ) + 2,
                        LEN(
                            [Related issues]
                        ) 
                        FIND(
                            ,,
                            [Related issues]
                        ) + 1
                    )
                ) + 1,
                2 +
                N(
                    appended to or from to the 4# of id of related issue
                )
            )
        ),
       
    )
)

    1. This splits, extracts and copies values from a none to multi-value column for better sortability: image
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: