ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   What does this number format do? (https://www.excelbanter.com/excel-discussion-misc-queries/11339-what-does-number-format-do.html)

Simon Thorn

What does this number format do?
 
If I format a cell as a currency with symbol '$ French (Canada) the
custom format string generated is "#,##0.00 [$$-C0C]_-".. what does
the trailing minus sign do? It seems to have no effect when switching
between positive/negative/zero values..

Cheers,

Simon Thorn
XLCubed Ltd

Dave Peterson

Try this on a new worksheet.

Format A1 with this:
#,##0.00 [$$-C0C]_-

Format A2 with
#,##0.00 [$$-C0C]

Type 123.45 in A1 and B1

You'll see part of the difference.

The underscore tells excel to reserve the next character's width even if
(especially if) it's not used.

You can see it more in a format like:
_(#,##0_);(#,##0);_(0_);_(@_)

PositiveFormat;NegativeFormat;ZeroFormat;TextForma t

If the number is positive, then excel will reserve room for where the ()'s would
go. It makes things line up nicer.

(and same with zero and text values)


Simon Thorn wrote:

If I format a cell as a currency with symbol '$ French (Canada) the
custom format string generated is "#,##0.00 [$$-C0C]_-".. what does
the trailing minus sign do? It seems to have no effect when switching
between positive/negative/zero values..

Cheers,

Simon Thorn
XLCubed Ltd


--

Dave Peterson

Simon Thorn

Thanks for your reply Dave.. I already know that the underscore is
used for spacing but I'm still unclear as to what the purpose of the
trailing minus sign is - it doesn't seem to do anything..?

Cheers

Si.

JE McGimpsey

You don't understand *how* "the underscore is used for spacing".


The underscore indicates that enough space for the character that
follows it is to be inserted. So the width of the - sign *is* the amount
of space to be inserted.

If you wanted the width of the underscore inserted, you' use two of them.




In article ,
(Simon Thorn) wrote:

Thanks for your reply Dave.. I already know that the underscore is
used for spacing but I'm still unclear as to what the purpose of the
trailing minus sign is - it doesn't seem to do anything..?


Simon Thorn

Cheers! NOW I get it!

Please speak slowly and clearly! ;-p

JE McGimpsey wrote in message ...
You don't understand *how* "the underscore is used for spacing".


The underscore indicates that enough space for the character that
follows it is to be inserted. So the width of the - sign *is* the amount
of space to be inserted.

If you wanted the width of the underscore inserted, you' use two of them.



All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com