Another excel formula situation

后端 未结 3 899
遇见更好的自我
遇见更好的自我 2021-01-26 09:29

I want to be able to display a difference in seconds as (+4.15) or sometimes negatively as (-4.15) and include the parentheses and plus/minus sign.

How can I use a form

相关标签:
3条回答
  • 2021-01-26 10:06

    You can achieve this with the regular cell formats option in excel.

    Format your cells to show the number in this way. Or if you need something other than the already available options, then use custom formats.

    0 讨论(0)
  • 2021-01-26 10:15

    Something like this should work:

    =TEXT(B1-A1,"+##.##;-##.##")
    

    Though as Jon says - editing the cell format is far more appropriate generally to avoid an issue, select custom and use this:

    +##.##;-##.##
    
    0 讨论(0)
  • 2021-01-26 10:18

    Your desired results (e.g. +4.15 and -4.15 ) are not covered by the various available standard number formats but you can easily apply a custom number format aka CNF.

    A CNF can have up to four parts; positive numbers, negative numbers, zero and text. The following will display positive numbers as black and a plus sign, negative numbers as red with a minus sign, a single grey dash instead of zero and blue text. The latter should never be actually used but the blue text will quickly show text that should have been interpreted as a number. The true numbers will be 'padded' off the right edge by a single space.

    [Black]_(+#,##0.00_);[Red]_(-#,##0.00_);[Color10]_(* "-"_);[Blue]_(@_)
    

    Example:

    More on custom number formats at Create or delete a custom number format

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