HolidayBuyer's Guide

Office & Productivity Software forum

General discussion

Custom number format in Excel

by chaitanya / March 19, 2004 2:10 AM PST

I need to create a custom number format in Excel in the following format-

that, is the first three digits right of the decimal should be in one group and thereafter 2 digits in a group.
Tried to create it but cant understant how to...

Discussion is locked
You are posting a reply to: Custom number format in Excel
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Custom number format in Excel
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Re:Custom number format in Excel
by Poorgrunt / March 19, 2004 2:43 AM PST

Are all the numbers the same length? If so, try putting the comma in quotation marks as in: "," under Format Cells CUSTOM (I assume you already know the "Create or delete a custom number format" procedure).

In other words, your custom format would look like:


However, shorter numbers will have leading comma's and larger numbers will revert back to norm.

Sorry, not really a solution, more of a "work around"- it is an interesting problem- I would be interested in how it is best solved.

Collapse -
Re:Re:Custom number format in Excel
by Kees Bakker / March 19, 2004 4:05 AM PST

Had I seen your reply before I posted mine (it took me some time to find out the solution below) I wouldn't have written it. But now I can tell you the way to do it when some of the numbers are shorter.

Write your own custom format function (via Tools/Macro/Visual Basic, create a module first, then a function). Use the format for the longest number to fill a temporary variable, which can become something like ,,,,1.00. Then loop through this variable to find the first non-comma (use mid-function) and extract the final part (use right function and len-function).

Just try it if you're interested. Only moderate programming skills are required.


Collapse -
Re:Re:Re:Custom number format in Excel
by JethroUK / March 20, 2004 7:27 AM PST

since "Only moderate programming skills are required." - maybe you would like to show us this function

Collapse -
Re:Re:Re:Re:Custom number format in Excel
by Kees Bakker / March 20, 2004 6:06 PM PST

To solve one possibly misunderstanding: it's not a way to format the cell you type the number in. It's a way to get the formatted number into another cell.

With some assistance of the help I've got just enough programming skills in VBA to do this, with an example from a book to start with.

You might start with a function that's says "Hello world." in cell B1 if you type anything in cell A1. Of course, this can easily be done with a formula, but it will give you a feeling of making a function in VBA. Then change the string from 'Hello world." to the formatted number in A1 with your own format (use format-function), then use some character handling functions (like mid, left, right, len) to finish it off.

It's highly instructive and educational to do so yourself.


Collapse -
Re:Custom number format in Excel
by Kees Bakker / March 19, 2004 3:48 AM PST

My Excel (97) simply refuses to treat the comma as anything else than a thousands separator. Even if I specify ##,##,##,##0.00 it puts 3 digits between the comma's.

However, you can substitute any character you like for the comma and then it will be accepted. It can be A for example, returning 12A34A56#78A999,00. And it can be alt-0-1-3-0 (numlock on, presumably), which in Arial or Tahoma looks like a normal comma to you and me, but is in fact a single low-9 quotation mark (see, the definition of the Windows character set).

So that would be the solution for your custom format, I think. Simply don't use a comma but something that looks like it.

Hope this helps.


Hope this helps.

Popular Forums
Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


Cameras that make great holiday gifts

Let them start the new year with a step up in photo and video quality from a phone.