简体   繁体   English

如何忽略图表中的非数字单元格?

[英]How do I ignore non-numeric cells in a chart?

In Excel 2016, I have time series that may contain cells with missing data, typically labelled with a string.在 Excel 2016 中,我的时间序列可能包含缺少数据的单元格,通常用字符串标记。 I'd like to plot the series ignoring non-numeric cells, but Excel wants to plot them as zeros.我想绘制忽略非数字单元格的系列,但 Excel 想将它们绘制为零。 Here is how it looks:这是它的外观:

字符串被转换为零

A workaround could be to create another column with something like一种解决方法可能是使用类似的内容创建另一列

=IF(C13="#N/A N/A",NA(),C13)

as suggested here .正如这里所建议的。

However, I'd like to know if there is a way to avoid creating another column.但是,我想知道是否有办法避免创建另一列。 Please note that I have selected the option: "Hidden and Empty Cell Settings"/"Show empty cells as: Gaps", but that doesn't seem to help.请注意,我选择了选项:“隐藏和空单元格设置”/“将空单元格显示为:间隙”,但这似乎没有帮助。

Yes that's right, Excel Graph treats strings as zeros.是的,没错,Excel Graph 将字符串视为零。 The "Show empty cells as Gaps" option under "Hidden and Empty Cell Settings" won't work either, since these aren't empty cells. “隐藏和空单元格设置”下的“将空单元格显示为间隙”选项也不起作用,因为这些不是空单元格。

Apart from creating another column, there are a couple of alternatives that you can think of.除了创建另一列之外,您还可以想到几种替代方法。

Possible solutions:可能的解决方案:

  • Option 1 - The solution to this is what was actually considered as an issue in your provided link .选项 1 - 对此的解决方案实际上被视为您提供的链接中的问题。 If the "Series" column contains #N/A instead of #N/AN/A as shown in your screenshot, Excel Graph will ignore those items and will display what is desired.如果“系列”列包含#N/A而不是屏幕截图中显示的#N/AN/A ,Excel Graph 将忽略这些项目并显示所需内容。 If this column contains formula such as VLOOKUP , it should automatically generate "#N/A" for errors and the graph will ignore that.如果此列包含诸如VLOOKUP公式,它应该自动为错误生成“#N/A”,并且图表将忽略它。

  • Option 2 - The other option being not to show the date if the "Series" column data is not a number.选项 2 - 如果“系列”列数据不是数字,则另一个选项是不显示日期。 So if the cell address with the date "28/12/2016" is A3 , replace it with the formula =IF(ISNUMBER(B3),A2-1,"") and copy it to rest of the rows below.因此,如果日期为“28/12/2016”的单元格地址为A3 ,请将其替换为公式=IF(ISNUMBER(B3),A2-1,"")并将其复制到下面的其余行。

Surround your function with an iferror .iferror包围你的函数。 For example, write: =IfError(YourFunction, "") .例如,写: =IfError(YourFunction, "") This way, you will have a blank cell if there is an error and the graph with not represent it.这样,如果有错误,您将有一个空白单元格,并且图形不代表它。

有人可以帮我吗,我一直在尝试对Microsoft excel工作表进行数字编号,并跳过16个单元格,所以当我打印的只是顶部的数字时,我该怎么做,所以不必手动将数字更改为100张

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM