Excel Pragma

July 30, 2006

Deciphering the Excel 2003 Custom Number Formats

Filed under: Formatting — Fadi @ 9:21 am

For the most part, the different number categories in the Category list box and their types are pretty easy - if not a breeze - to comprehend. For most people, that self-assured feeling goes right out the window as soon as they click the Custom category and get a load of its
accompanying Type list box, shown in Figure 1. It starts off with the nice word General, then 0, then 0.00, and after that, all hell breaks loose! Codes with 0s and #s (and other junk) start to appear, and it only goes downhill from there.


Figure 1: Selecting Custom in the Category list box of the Number tab.

As you move down the list, the longer codes are divided into sections separated by semicolons and enclosed within square brackets. Although at first glance these codes appear as so much gibberish, you’ll actually find that they’re quite understandable (well, would you believe useful, then?).

And these codes can be useful, especially after you understand them. You can use them to create number formats of your own design. The basic keys to understanding number format codes are as follows:

    * Excel number formats use a combination of 0, ?, and # symbols with such punctuation as dollar signs, percent signs, and commas to stand for the formatted digits in the numbers that you format.

    * The 0 is used to indicate how many decimal places (if any) are allowed in the format. The format code 0.00 indicates that two decimal places are used in the number. The format code 0 alone indicates that no decimal places appear (the display of all values is rounded up to whole numbers).

    * The ? is used like the 0, except that it inserts spaces at the end as needed to make sure that values line up on the decimal point. For example, by selecting the number format 0.??, such values as 10.5 and 24.71 line up with each other in their cells because Excel adds an extra space after the 5 to push it over to the left so that it’s in line with the 7 of 71. If you used the number format 0.00 instead, these two values would not line up on the decimal point when they are right-aligned in their cells.

    * The # symbol is used with a comma to indicate that you want thousands, hundred thousands, millions, zillions, and so on in your numbers, with each group of three digits to be separated with a comma.

    * The $ (dollar sign) symbol is added to the beginning of a number format if you want dollar signs to appear at the beginning of every formatted number.

    * The % (percent sign) symbol is added to the end of the number format if you want Excel to actually transform the value into a percentage (multiplying it by 100 and adding a percent sign).

Number formats can specify one format for positive values, another for negative values, a third for zero values, and even a fourth format for text in the cells. In such complex formats, the format codes for positive values come first, followed by the codes for negative values, and a semicolon separates each group of codes. Any format codes for how to handle zeros and text in a cell come third and fourth, respectively, in the number format, again separated by semicolons. If the number format doesn’t specify special formatting for negative or zero values, these values are automatically formatted like positive values. If the number format doesn’t specify what to do with text, text is formatted according to Excel’s default values. For example, look at the following number format:

#,##0_);(#,##0)

This particular number format specifies how to format positive values (the codes in front of the semicolon) and negative values (the codes after the semicolon). Because no further groups of codes exist, zeros are formatted like positive values, and no special formatting is applied to text.

If a number format puts negative values inside parentheses, the positive number format portion often pads the positive values with a space that is the same width as a right parenthesis. To indicate this, you add an underscore (by pressing Shift and the hyphen key) followed immediately by a closed parenthesis symbol. By padding positive numbers with a space equivalent to a right parenthesis, you ensure that digits of both positive and negative values line up in a column of cells.

You can assign different colors to a number format. For example, you can create a format that displays the values in green (the color of money!) by adding the code [GREEN] at the beginning of the format. A more common use of color is to display just the negative numbers in red (ergo the saying “in the red”) by inserting the code [RED] right after the semicolon separating the format for positive numbers from the one for negative numbers. Color codes include [BLACK], [BLUE], [CYAN], [GREEN], [MAGENTA], [RED], [WHITE], [YELLOW], and [COLOR n] where n is the number of the Standard Color between 1 and 16 that you want to select from the Excel color palette. (To see the palette and its colors, choose Tools –> Options and then select the Color tab. When assigning a number to a color, count from left to right across each row: 1 to 8 across the top row and 9 to 16 across the second row, and so on.)

Date number formats use a series of abbreviations for month, day, and year that are separated by characters, such as a dash (-) or a slash (/). The code m inserts the month as a number: mmm inserts the month as three-letter abbreviation, such as Apr or Oct, and mmmm spells out the entire month, such as April or October. The code d inserts the date as a number: dd inserts the date as a number with a leading zero, such as 04 or 07; ddd inserts the date as a three-letter abbreviation of the day of the week, such as Mon or Tue; and dddd inserts the full name of the day of the week, such as Monday or Tuesday. The code yy inserts the last two digits of the year, such as 05 or 07; yyyy inserts all four digits of the year, such as 2005, 2007, and so on.

Time number formats use a series of abbreviations for the hour, minutes, and seconds. The code h inserts the number of the hour; hh inserts the number of the hour with leading zeros, such as 02 or 06. The code m inserts the minutes; the code mm inserts the minutes with leading zeros, such as 01 or 09. The code s inserts the number of seconds; ss inserts the seconds with leading zeros, such as 03 or 08. Add AM/PM or am/pm to have Excel tell time on a 12-hour clock, and add either AM (or am) or PM (or pm) to the time number depending upon whether the date is before or after noon. Without these AM/PM codes, Excel displays the time number on a 24-hour clock, just like the military does. (For example, 2:00 PM on a 12-hour clock is expressed as 1400 on a 24-hour clock.)

So that’s all you really need to know about making some sense of all those strange format codes that you see when you select the Custom category on the Number tab of the Format Cells dialog box.

Article : Deciphering the Excel 2003 Custom Number Formats posted on AllBusiness.com
From the Excel 2003 All-in-One Desk Reference For Dummies.

Technorati Tags: ,

July 11, 2006

Scroll Protection

Filed under: Formatting, General — Admin @ 2:50 am

Without Protection

You can protect a spreadsheet so that data is shielded from inadvertent entries.
There is another way to set up a scroll area that does not involve protection.
Open the Control Toolbox (right-click any existing tool bar) and click on the Properties icon.

In the Scroll Area text box, type the scroll area range, or type the defined Name for the range.
To cancel the Scroll Area restricted range, clear the Scroll Area text box.

 

If you are using Office 2007, the Property icon is on the Developers tab.

 

Multiple areas can be selected using Protection, but only one area is allowed using the Scroll Property.

Via Unofficial Microsoft Office Stuff

July 10, 2006

Great new online community

Filed under: Blogging, Sites — Admin @ 11:50 am

Hi, everyone! Cool, new online resource to mention today… The Microsoft Work Essentials Web site has started new discussion forums for those who use Office in finance, sales, marketing, office administration, project management, and IT roles. You can post questions in the Work Essentials Community Forums and moderators will help you find answers from their community of experts.

These forums are just getting started – so jump in and take advantage of the opportunity … and help make a success of a new online resource at the same time.

Check out the Work Essentials forums here: http://forums.microsoft.com/WorkEssentials/default.aspx?SiteID=32

Or, if you are an expert in one or more of these areas and want to learn more about getting involved in this new community, e-mail the Work Essentials folks at weexpert@microsoft.com

Happy weekend everybody!

via OfficeZealot.com

April 29, 2006

Excel Drawings

Filed under: Gadgets — Admin @ 9:45 pm

This has been on the blogs for the past two days : 58 Days Worth of Drawing Exercises in Microsoft Excel . I have yet to see Excel play mp3s (with visualisations?).

March 8, 2006

Dashboard Templates - Excel User

Filed under: Formatting, Sites — Admin @ 6:47 am

Interesting dashboard formats and ideas at Excel User, very handy for consolidated portfolio views for example.

Different layouts are presented in the gallery. if you don’t want to waste time (or space), check the  extreme dashboard : Postage Stamp Report.

 

Free Excel Spreadsheet - Peacock Capital

Filed under: Sites — Admin @ 2:55 am

Peacock Capital specialises in solving the cash flow challenges of  Small/Medium Businesses, Government Vendors and Individuals with alternative financing solutions.[Link]

The amount of models on this site is impressive ranging from Corporate Finance and Focused Valuations models all the way to Option Pricing.

 

Regular Expressions

Filed under: Data Analysis, Sites — Admin @ 2:49 am

Regular expressions are a system for matching patterns in text data, which are widely used in UNIX systems, and occasionally on personal computers as well. They provide a very powerful, but also rather obtuse, set of tools for finding particular words or combinations of characters in strings.

[Link]

February 13, 2006

Color Picker

Filed under: Formatting, Sites — Admin @ 11:55 pm

Another colour link , but this time for an “essential” tool : colour picker.

Color Palettes

Filed under: Formatting, Sites — Fadi @ 7:41 am

I’ve been looking for a brown palette. I still haven’t found a nice one but found a couple of sites which will definitely come in handy next time I need colours.

1 – Site Blender – Palette/Theme generator

2– Color Mixers – Palette/Theme generator

April 21, 2005

Another article on migrating VBA to VSTO

Filed under: General — Fadi @ 7:52 am

Here’s another article from Microsoft’s Office Developer Center : Convert VBA Code to Visual Basic .NET When Migrating to Visual Studio 2005 Tools for Office .

Why Migrate to Visual Studio 2005 Tools for Office :

  • Improved development productivity
  • Improved security model
  • Easier deployment and versioning
  • Added functionality from the Microsoft .NET Framework
  • Improved code reuse
  • Easier integration

Here’s where I think problems might occur for VBA immigrants :

  • different data types (Long, Short, Integer & Co.)
  • dates manipulation (.fromOAdate, .toOADate methods)
  • no more Option Base (never used it)

What I like :

  • Scope of variables : variables can be defined even within a For … Next loop instead of being defined for the whole procedure or function.
  • Exception Handling with new statements like “Try … Catch ex As Exception … Finally… End Try” for error trapping.

It doesn’t look like the migration would be too painful. I suppose it’s just a matter of getting used to the object model, the user interface and the error trapping…

hmmm… rephrase : If you manage to get used to the object model, the user interface and the error trapping then the migration should not be painful.

rephrase : I am not a reference. so good luck.

Newer Posts »

Powered by WordPress