cellMatrix.net

Spreadsheet Modeling and Related Topics

Dynamic Chart - Show Range Between Values

The following example uses a combination of defined names and array formulas to dynamically chart a range between a high and low value. In the screenshot below, data is entered into the yellow shaded cells. The chart source is within the white grid range E3:F22.

image

The first step to creating the chart is to build four named ranges. Three of the four named ranges will act as components of the array formulas that make up the chart source. Each of the formulas can be viewed in the screenshots of the named range dialog boxes below:

The first named range is called "Data":

image

The second named range is called "Labels":

image

The third named range is called "List":

image

The fourth and final named range is called "Values":

image

Two array formulas make up the chart source. To enter an array formula, select the entire range, enter the formula into the formula bar, and then hit the CONTROL - SHIFT - ENTER keys at the same time.

The first array formula below covers the range E3:E22.

=IF(ISERR(SMALL(IF(Data=F3,ROW(Data)-MIN(ROW(Data))+1),COUNTIF($F$3:F3,F3)))," ",
INDEX(List,SMALL(IF(Data=F3,ROW(Data)-MIN(ROW(Data))+1),COUNTIF($F$3:F3,F3))))

The second array formula below covers the range F3:F22.

=IF(ISERR(SMALL(IF(Data>=$H$3,IF(Data<=$H$2,ROW(INDIRECT("1:"&ROWS(Data))))),
ROW(INDIRECT("1:"&ROWS(Data))))),"",INDEX(Data,SMALL(IF(Data>=$H$3,
IF(Data<=$H$2,ROW(INDIRECT("1:"&ROWS(Data))))),ROW(INDIRECT("1:"&ROWS(Data))))))

Finally, it's time to create the chart. Assuming that the file name is "RangeBetween.xls", the chart source dialog box looks like this:

image




Posted on Saturday, November 24, 2007 | Comments (0) | Permalink

Comment Entry Form

User Information

Name: (Required)

E-Mail Address: (Optional)

Location: (Optional)

Web Site Address: (Optional)

Comment Formatting Reference
Add VBA Code:
<pre>some code here</pre>
Linking:
[url]http://www.example.com/[/url]
[url=http://www.example.com/]my site[/url]
Text Formatting
[size=4]Some larger text[/size]
[color=green]Some green text[/color]
[b]Some bold text[/b]
[i]Some italic text[/i]
Enter Comment Below

Personalization Options
Remember my personal information
Notify me of follow-up comments?

Next entry: Breakeven Chart with Dynamic Label

Previous entry: Why Use Pie Charts?

<< Back to main

Statistics

  • Total Entries - 136
  • Current Viewers - 16

Categories

Entries by Day

Sep - 2010
S M T W T F S
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 1 2

Recent Comments

Syndicate