To create the first range name, select the range B3:B10; choose Formulas, Defined Names, Define Name; enter the name StatData; then choose OK. Take the same approach for the other two names. (You also can choose Ctrl+F3 to launch the Name Manager dialog, then click on New to enter the new name.) Format the rows and columns as shown in the figure, then enter the data shown above. (You can't read most of the text in this figure. But I made up the text anyway, so enter any text you want.) Here are some things to watch out for:
The Control Worksheet
Cell B5 contains a formula that returns the column number within the database for the value entered for the CurMonth. Enter the formula for the cell shown: B5: =MATCH(CurMonth,Dates,0) This formula finds the CurMonth value in the range named Dates (as explained in the previous section) and returns the column number for that date. The zero in the last argument tells Excel to find an exact match. Because the formulas in the figures below all refer to the ColNum range, the figures automatically update when you change the CurMonth date in cell B2 above. The Horizontal FigureHere is the figure shown at the beginning of this article, with the row and column headings included:
I used the techniques described in Display Any Colors in Excel to format the colors for this figure. But for now, rather than dark green and gray tan, let's suppose you want to use blue and gray for your version of this figure: 1. Add a new worksheet to your workbook. 2. Select cell B2 and assign a blue color pattern. To do so, use the Fill Color tool in the Font group of your Home tab. 3. Enter the text "stat1_" in cell B2. (You also could enter "Stat1_" because the case doesn't matter.) Then format the cell's font as blue. To do so, use the Font Color tool in the Font group of the Home tab. Doing so makes the text invisible, which is what we want. (You'll see how we use this text shortly.) 4. Select the range C2:E2 and assign a black color pattern. Enter "KEY STAT" in cell C2 and assign a white font to that cell. Format the font as bold. The example uses the Cambria 14 font, but you can use any font you want. 5. Select the range B3:D7. This range needs to be merged into one large cell to contain the large number. To do so, choose Home, Alignment, Merge & Center. 6. The font in this cell is Cambria 40, Bold. You can use any font you want. 7. Select the range E3:I3. Merge this range into a large cell that's left-justified. The font in this range is Calibri 14, Bold. Apply any font settings you want. 8. Select the range E4:I7. Merge this range as well. The font for this range in the figure is Calibri 11. 9. Each merged range uses a formula to return data from the database. Enter these formulas for the ranges shown: B3: =INDEX(Data,MATCH(B2&"Data",StatData,0),ColNum) In cell B3, the reference to cell B2 returns "stat1_". When combined with "Data", the MATCH function searches for "stat1_Data" in the StatData range, and returns that label's row index number. The INDEX function returns the value in Data for that row, and for the appropriate column number. The other two formulas work similarly. To copy this figure, just copy and paste it. The formulas in the new figure will point to the text in its top-left cell. To use this figure with the Stat2 dataset, merely enter "Stat2_" in the top-left cell of the figure, and then recalculate. The Vertical Figure Use the same approach to create this figure as the previous one. Here, however, enter the text "Stat2_" in cell B2. Displaying the FigureWhether you use the horizontal or vertical versions of these figures, they look best when their column widths are set carefully. Therefore, you should create each figure in an area of a worksheet where you can control row and column sizes, and then use Excel's Camera Tool to display each figure in your report sheet. The article Add Class to Your Reports With Excel Drawing Objects explains how to use the Camera tool. You can download the workbook and the Key Stat examples using this link. |
|
ExcelUser, Inc.
http://www.ExcelUser.com
Copyright © 2004 - 2008 by Charles W. Kyd, all rights reserved. Content, graphics, and HTML code are protected by US and International Copyright Laws, and may not be copied, reprinted, published, translated, hosted, or otherwise distributed by any means without explicit permission. Terms of Use | Privacy Policy | Earnings Policy. |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||