Stop special format 0000 from being changed to a Zip code

David20

Board Regular
Joined
May 7, 2009
Messages
57
I'm trying to set a cell to accept a 4-digit number that may have leading zeros. I've set Numbers - Special Formatting to "0000" but Excel changes it to be a postal zip code from Portugal. Any idea how to keep it from using an existing formatting when I want to use a custom special formatting?
 
After some playing around I came up with a custom number format that seems to work....
_00000 no quotes or anything. The format also keeps the cell as a number so you should be able to do calculations on it.
It doesn't make sense to me but it seems to work
 
Upvote 0

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
After some playing around I came up with a custom number format that seems to work....
_00000 no quotes or anything. The format also keeps the cell as a number so you should be able to do calculations on it.
Interesting, although I probably would not use a 0 after the underbar as that might confuse people into thinking the value should be zero-padded to 5 places, not 4. May use the "standard" left parenthesis instead?

_(0000

EDIT NOTE: Just tried it will a single space in front of the 4 zeroes (instead of the underbar/right parenthesis) and that works also (and looks more "natural" in the Custom Format Type field as well).
 
Last edited:
Upvote 0
How about this?

0000;0000;0000

Or even

0000;
 
Upvote 0
Solution
Interesting, although I probably would not use a 0 after the underbar as that might confuse people into thinking the value should be zero-padded to 5 places, not 4. May use the "standard" left parenthesis instead?

_(0000

EDIT NOTE: Just tried it will a single space in front of the 4 zeroes (instead of the underbar/right parenthesis) and that works also (and looks more "natural" in the Custom Format Type field as well).

I agree with you on the extra "0", didn't really think about the fact that others might be looking at it, I really like the leading space idea much better
 
Upvote 0
I can duplicate this problem on Excel 2007 (all updates installed), but the problem does not occur on Excel 2000 which I have on an older computer that hasn't been updated since 2009.
 
Upvote 0
I can duplicate this problem on Excel 2007 (all updates installed), but the problem does not occur on Excel 2000 which I have on an older computer that hasn't been updated since 2009.
I am duplicating the problem on XL2003 (SP3). The problem could still be in some "core" Office or Excel DLL that got updated (one that XL2000 and earlier didn't use)... again, if this is not a "new problem" I find it strange that it has not been noticed before.
 
Upvote 0

Forum statistics

Threads
1,223,264
Messages
6,171,081
Members
452,377
Latest member
bradfordsam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top