Numeric sign placement in custom format

J

Jennifer Murphy

I would like to format some cells with the text prefix "X = ".

I've done this many times in the past with no problems, but apparently
never had any negative numbers.

The custom format string I am using is ["x = "0.000].

For positive numbers, it works fine. But for negative numbers, the "-"
sign is placed before the "x":

-x = 3.45

instead of before the number

x = -3.45

Can someone help me fix this?
 
J

joeu2004

Jennifer Murphy said:
The custom format string I am using is ["x = "0.000].
For positive numbers, it works fine. But for negative
numbers, the "-" sign is placed before the "x":
-x = 3.45
instead of before the number
x = -3.45
Can someone help me fix this?

The following Custom format works for me:

"x = "General;"x = "-General;

You can use other formats, for example:

"x = "0.00;"x = "-0.000;
 
J

Jennifer Murphy

Jennifer Murphy said:
The custom format string I am using is ["x = "0.000].
For positive numbers, it works fine. But for negative
numbers, the "-" sign is placed before the "x":
-x = 3.45
instead of before the number
x = -3.45
Can someone help me fix this?

The following Custom format works for me:

"x = "General;"x = "-General;

You can use other formats, for example:

"x = "0.00;"x = "-0.000;

That works, thanks.

I was hoping for a code that I could include in the single string to
tell Excel where to put the decimal point. I don't like having to
repeat the string just to get the decimal point placed. Just one of
the many joys of Excel, like most MSFT products.

Actually, I think it's silly that the decimal point doesn't go right
in front of the number by default.

Anyway, thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top