JKP Application Development Services.

                    Microsoft Office Application Development

Excel Headlines

Up • News • Excel Headlines • Products • Recommendations • Services • Contact • Excel Articles • Excel Books • Downloads • Links • All Comments • Search

•  •

Search Zoeken

WWW
This site

Go to Ga Naar
Home
Up

Donate Donaties
Did you find something helpful on my site? Consider a donation!
Heeft u iets gevonden waar u wat aan had? Overweeg dan een donatie!

 

Excel Headlines

My very own list of news on Excel, gathered from various sources!

This site

New article: Showing An Array On A Form; Autosizing ColumnWidths Of A ListBox
For a project I needed a quick way to display the content of an array to the user. I didn't want to use a worksheet, but opted for a userform. The data I wanted to show was contained in an array. So I figured I'd put a listbox on a userform and make sure the column widths of the listbox resize with the data I want shown. That proved far from easy...
Wed, 14 May 2008 18:15:00 GMT
Update: Name Manager (version 4.1, build 603)
Updated Name Manager: Fixed a bug: when hidden name is edited, it used to become unhidden. When one adds names and the filter is set to show hidden names, new names are hidden by default.
Tue, 13 May 2008 18:45:00 GMT

Daily Dose Of Excel

By Dick Kusleika (et al)
Recording Macros
There’s an interesting discussion at Smurf about the macro recorder. I rarely use it, but I used to use it quite often. I actually just used it last week for something to do with FormatConditions, but I don’t remember the details. Intellisense or the Object Browser usually gets me where I want [...]
Thu, 15 May 2008 18:11:41 +0000
Showing An Array On A Form; Autosizing ColumnWidths Of A ListBox
Hi all, For a project I needed a quick way to display the content of an array to the user. I didn’t want to use a worksheet, but opted for a userform. The data I wanted to show was contained in an array. The array contained something like: Description Before After Cell Errors 100 10 Corrupt Names 1000 0 Unused styles 232 0 So I figured I’d put a [...]
Wed, 14 May 2008 17:39:30 +0000

The Ken Puls Blog

By Ken Puls
The best line of VBA ever
Okay, I'll admit that you probably have to be a parent of a young child to agree with this, but here it is: PLAIN TEXT CODE: Application.Speech.Speak Target This all started when I showed my kid how fast the computer could count to 100 with this code: PLAIN TEXT CODE: Sub Count() Dim lCount As Long For lCount = 1 To 100 With ActiveCell .Value = [...]
Tue, 06 May 2008 05:53:38 +0000
mscms.dll error
This is a big irritation... I've started getting errors every time I open an Office application.  Specifically, the error message reads: "EXCEL.EXE - Bad Image C:\Windows\system32\mscms.dll is either not designed to run on Windows or it contains an error.  Try installing the program again using the original installation media or contact your system administrator or the software vendor [...]
Mon, 05 May 2008 05:22:51 +0000

.NET & Excel

By Dennis Wallentin
Check which Excel version is installed
Whenever I need some enviroment information I always tries to read the wanted values from Windows registry.  In VB.NET this is as rather straightful process as we have access to the namespace “Microsoft.Win32′ which includes the class to work with the registry. Recently I had a need to find out if Excel is installed and if [...]
Sun, 27 Apr 2008 14:31:38 +0000
VB Snippet Editor
Together with a lot of Intellisense improvements a large number of Code Snippets is also shipped with VB 2008. But what may be surprising is that there is no tool included to create and manage our own Code Snippets with.  This is where VB Snippet Editor comes in. It gives us the option to develop our own snippets [...]
Sun, 13 Apr 2008 11:57:20 +0000

PTS Blog

By Jon Peltier

An error has occured while trying to process http://peltiertech.com/WordPress/feed/
Please contact web-master.

Professional Office Developers Association's Blog

By various Authors
MS Access on the Fly
MS Access databases are great for quick data synthesis applications.  The ability to create, populate, and then extract data can really simplify situations where consolidation of information is the eventual goal. A little while back, we put in place a tool that makes life easier for our project management office function. The following describes the [...]
Tue, 22 Apr 2008 15:16:05 +0000
Putting the Microsoft WebBrowser to Work
The Microsoft Webbrowser control (windows\system32\shdocvw.dll) may be included in the VBA controls toolbox and subsequently used to present web pages within a userform or other MS Office container. I typically develop application "help" files using MS Frontpage and until recently have been using the FollowHyperlink method (Excel, Word) to present the help page using Internet Explorer.  [...]
Tue, 22 Jan 2008 19:36:16 +0000

Putting You & I Back Into Office 2007 UI

By Patrick Schmid
RibbonCustomizer bug fixes
I just posted a new RibbonCustomizer release with lots of bug fixes related to custom image handling. Unfortunately, I had to change the image handling code substantially. This new release cannot read images created with the previous one. It should simply not load them and you can add them manually again. If you encounter problems with [...]
Mon, 29 Oct 2007 00:56:51 +0000
RibbonCustomizer - Use custom images
The newest beta version of RibbonCustomizer lets you now use your own custom images as icons on the Ribbon. The only limitation is that you cannot assign custom images to Microsoft commands. But you can assign your own images to all your macro buttons. Important warning: Files generated with the newest beta release cannot be read [...]
Wed, 03 Oct 2007 02:56:02 +0000

Microsoft Excel on MSDN

By various Authors
PivotTables: Calculated Items

Today's author: David Gainer, a Program Manager on the Excel team.

PivotTables are designed to help users make sense of large amounts of data by providing an easy way to build a summarized report. In addition, PivotTables can be rearranged easily, so that once you have some summary data in a PivotTable, you can look at the same information in many different ways with only a few mouse clicks. For a slightly less brief overview of PivotTables as well as a list of the improvements made to the application in Excel 2007, please check out this blog post.

Today I wanted to take a look at calculated items in PivotTables … specifically, what they are, how to create them, and some examples of how they can be useful. I find them to be very helpful, so I wanted to do a little evangelism, as well as point out some little-known features.

Let's start with what they are. According to Microsoft Knowledge Base Article 161882, "A calculated item is a user-defined item in a PivotTable field that can perform calculations using the contents of other fields and items in the PivotTable." While that's technically accurate, it may not be clear. Perhaps a simpler way to think about calculated items is that it is a feature that allows you to create new items (that are not part of the original source data) that can appear in fields in your PivotTable. Here's an example (lifted from the aforementioned KBA) – a picture may be worth 1000 words.

Assume that you have some sales data that you want to summarize in a PivotTable. You have data for four different sales regions (North, South, East, West) for a few months sales.

With a few clicks, you could create a summary PivotTable that looks like this.

So far so good, but let's now pretend there has recently been a reorganization, and the North and East regions are now the NorthEast region. How can you reflect that in your PivotTable without having to modify all the source data? By creating a calculated item which represents the NorthEast region, of course. To do that, you need to first click one of the "Regions" in the PivotTable report. This gives Excel the context of what you are going to add a calculated item to … specifically, that you are going to add an item to "Regions". Next, on the PivotTable "Options" contextual ribbon, select the "Formulas" drop-down and then select "Calculated Item …".

This should present you with a dialog thus:

This dialog is used to create calculated items (unsurprisingly enough). While it may look a bit cryptic, it is pretty straightforward. The bottom-left control shows you the fields available in your PivotTable, the bottom-right control shows you the items in those fields, and the top controls allow you to create your calculated items. For example, to create a new NorthEast region, you simply need to type "NorthEast" in the Name control, = North + East in the Formula control …

… press the Add button, and then press OK to dismiss the dialog. Now you should see your PivotTable with a new item – NorthEast – listed with the rest of the Regions. You can see that Excel simply aggregated the values for the two regions in questions, which is what we asked Excel to do with our "= North + East" formula. Essentially, you have added new information to your PivotTable, and that information behaves just like all the other data in the PivotTable … you can sort it, filter it, pivot it, etc., all without restriction.

If I now use standard PivotTable filtering functionality to filter out the North and East regions, I have a simple three-line PivotTable that reflects the reorganized sales regions, not the underlying source data.

The fun is not quite over yet, though. Once you have created a calculated item, you can continue to modify it without necessarily returning to the dialog we just looked at. For starters, you can type over the caption "NorthEast" and Excel will remember the new caption. Additionally, if you click on one of the calculated fields, you will see that you can see the formula you entered in the dialog is also available (and editable) in the Excel formula bar. Here is a shot, for example, of what happens when I select one of the cells reporting data for the new NorthEast region and hit F2 (the hotkey to edit a formula).

From here I could change the formula (=North+South), add a constant (=North+East+100), or use any of Excel's native functions, and the value in the cell would update when I pressed Enter. It is worth bearing in mind that this changes the formula for that intersection only (in this case, "Apr" of the "NorthEast" region only, so if you want to change all the cells in one fell swoop, best to return to the Calculated Items dialog.

So that is an overview of the feature set. Now let's look at a few examples of more interesting usage cases that were created by one of my co-workers. First, let's look at an example where calculated items are used to show relationships between different classes of products.

As you can see the PivotTable above summarizes sales, cost of sales, and margin for different classes of products – alcoholic beverages, dairy, beverages, etc. In this case, the report author wanted to add another piece of information – the percentage of overall sales that were related to alcoholic beverages. They accomplished this by adding a calculated item to the "Product Department" field that looked like this: =IF('Alcoholic Beverages'=0,NA(),'Alcoholic Beverages'/SUM('Alcoholic Beverages',Beverages,Dairy)). You can see this calculation uses a few Excel functions (IF, NA, SUM) in addition to referencing other items in the field in order to calculate the percentage in question. The reason for the IF and the NA functions is to return #NA if there are no alcoholic sales instead of a divide by 0 error.

Here is another interesting example. It turns out you can use a special syntax to refer to "next" and "previous" items in a field.

In this example, the PivotTable author had actual financial results for FY02 – FY04, and wanted to create a forecast for the next fiscal year based on the actual for those three years. You can see in the screenshot above that they used the following formula: =IF(Year[-1]=0,Year[-2],2*Year[-1]-Year[-2]). While at first this may look pretty cryptic, it is actually fairly straightforward. The formula says "if last year's sales (which is what "Year[-1]" means) is 0, the projection is sales from 2 years ago, else the projection is two times last year's sales minus the sales from two years ago." The [-1] modifiers are simply used to tell Excel to refer to previous and next values in that field, and it is particularly (but not exclusively) useful for financial calculations involving time periods.

That summarizes the calculated items feature. There is a closely related feature called "calculated fields" which should be simple enough to figure out after reading this post (and there are other articles out there on MSFT and other web sites you can refer to if you are interested). If you have any feedback on this feature, we are all ears. Thanks!


Fri, 09 May 2008 05:07:00 GMT

    Subscribe in a reader

powered by longhead.com

Use the contact page to issue questions or comments about this website.
Copyright © 2003-2007 JKP Application Development Services.