[英]Show only data between dates in excel chart
I have yearly.net profit data that uses spill formulas in Columns A and B and in columns D and EI have used start and end date selectors in G2 and I2 to gather the subset of data for the chart.我有 yearly.net 利润数据,在 A 列和 B 列以及 D 列和 EI 中使用溢出公式,在 G2 和 I2 中使用开始和结束日期选择器来收集图表的数据子集。
The chart data has the Net Profit data range set to ='Yearly Net Profit':$E$2:$E$35
and the years are set to ='Yearly Net Profit':$D$2:$D$35
.图表数据的净利润数据范围设置为='Yearly Net Profit':$E$2:$E$35
并且年份设置为='Yearly Net Profit':$D$2:$D$35
。
As you can see from the image below, the chart graphs all the blank space from D10 onwards which I don't want.从下图中可以看出,图表绘制了 D10 之后的所有空白区域,这是我不想要的。
I tried using ='Yearly Net Profit'!$E$2#
but unfortunately it doesn't like this.我尝试使用='Yearly Net Profit'!$E$2#
但不幸的是它不喜欢这样。
I then added two entries in to the Name Manager, one for YearsForYearlyNetProfitFiltered set to ='Yearly Net Profit'!$D$2#
and the second YearyNetProfitFiltered set to ='Yearly Net Profit'!$E$2#
.然后我在名称管理器中添加了两个条目,一个YearsForYearlyNetProfitFiltered设置为='Yearly Net Profit'!$D$2#
,第二个YearyNetProfitFiltered设置为='Yearly Net Profit'!$E$2#
。
I re-selected the data for the chart, so Net Profit data became ='Yearly Net Profit'!YearyNetProfitFiltered
and the Years became ='Yearly Net Profit'!YearsForYearlyNetProfitFiltered
.我重新选择了图表的数据,因此 Net Profit 数据变为='Yearly Net Profit'!YearyNetProfitFiltered
并且 Years 变为='Yearly Net Profit'!YearsForYearlyNetProfitFiltered
。
Unfortunately this results in only one entry being visible, see image below:不幸的是,这导致只有一个条目可见,请参见下图:
You'll see in cells N and OI have output the named ranges.您会在单元格 N 和 OI 中看到 output 命名范围。 Why would the named ranges only have one entry?为什么命名范围只有一个条目?
I am not sure whether you are looking to create a dynamic chart or not, but you may try to follow the steps as is mentioned.我不确定您是否要创建动态图表,但您可以尝试按照提到的步骤进行操作。
A Quick Gif on the dynamic chart动态图表上的快速 Gif
Steps:脚步:
Insert
Tab --> Under Charts
Group --> Click Insert Column Or Bar Chart
--> Select 2D Clustered Column
Select 数据,然后从Insert
选项卡 --> 在Charts
组下 --> 单击Insert Column Or Bar Chart
--> Select 2D Clustered Column
YEAR
and another for the NETPROFIT
现在,创建两个公式,一个用于YEAR
,另一个用于NETPROFIT
• Formula for YEAR
• 年YEAR
=INDEX($A$2:$A$24,MATCH($D$2,$A$2:$A$24,0)):INDEX($A$2:$A$24,MATCH($F$2,$A$2:$A$24,0))
• Formula for NETPROFIT
• NETPROFIT
=INDEX($B$2:$B$24,MATCH($D$2,$A$2:$A$24,0)):INDEX($B$2:$B$24,MATCH($F$2,$A$2:$A$24,0))
Name Manager
by defining the respective names for each.通过为每个公式定义各自的名称来复制公式并放置在Name Manager
中。 Like as below:像下面这样:Chart Design
--> Select Data
接下来,select 图表, Chart Design
--> Select Data
Legend Entries Series
, Click On the Series of Net Profit
--> Click Edit
, a new window opens as Edit Series
在Legend Entries Series
下,单击Net Profit
系列 --> 单击Edit
,一个新的 window 打开为Edit Series
Series Values
remove everything except the sheet name and press F3
(Function Key) and select NETPROFIT from Paste Names
在Series Values
中删除工作表名称以外的所有内容,然后按F3
(功能键)和 select NETPROFIT从Paste Names
Horizontal (Category Axis Labels)
click on edit and do the same as above in bullet 6就像Horizontal (Category Axis Labels)
中的明智一样,单击编辑并在项目符号 6 中执行与上面相同的操作Start Year
& End Year
to see the changes you need it will show only the data from the range of years shown in the cells D2
& F2
.按确定,返回到 Excel。更改Start Year
和End Year
以查看您需要的更改,它将仅显示单元格D2
和F2
中显示的年份范围内的数据。 Note: I have used Millions
as display units for Y-Axis
.注意:我使用Millions
作为Y-Axis
的显示单位。 Here is a copy of the workbook这是工作簿的副本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.