简体   繁体   English

Excel更改单元格公式

[英]Excel changes cell formula

I work with an Excel file approx. 我使用的是Excel文件。 10,000 rows on each of 12 sheets. 每12张纸上10,000行。 This file is used quite a bit to pull data from (ie sorted, filtered, changed manually) but I never tamper with the columns that contain the formulae. 这个文件用于从中提取数据(即排序,过滤,手动更改)相当多,但我从未篡改包含该公式的列。

Over the past couple of weeks I've been noticing that some of the reference values within the cells have been changing. 在过去的几周中,我一直注意到单元格中的某些参考值一直在变化。 The only reason I saw this is because excel gracefully points out when a formula is different from the ones above and below it (with the small green arrows). 我看到这的唯一原因是因为excel优雅地指出了公式与其上方和下方的公式不同(带有绿色小箭头)。 Up to this point I've just gone and click "Restore to column formula". 至此,我刚刚单击“还原到列公式”。

Example: 例:

=IFERROR(IF(G148/E148>100%,100%,G148/E148),"")

had been changed to, 已更改为

=IFERROR(IF(G157/E157>100%,100%,G157/E157),"")

while still in Row 148. 而仍在第148行中。

Now this isn't a large pain to go and change all the values, its typically < 100 values. 现在,更改所有值(通常<100个值)并不麻烦。 But I'm fearing the day this turns into over 9000 values. 但是我担心这一天会变成超过9000个值。

My goal is to find out the root cause of this problem and nullify it from continuing to happen. 我的目标是找出此问题的根本原因,并使其不再继续发生。 I am using Excel 2010. 我正在使用Excel 2010。

EDIT: This is an example of the problem I'm speaking about. 编辑:这是我正在谈论的问题的一个示例。 The reference rows should continue in order, but you'll notice row 337, 341, and 345 have all changed to different rows (209, 224, 158 respectively). 参考行应按顺序继续,但是您会注意到行33、341和345已全部更改为不同的行(分别为209、224、158)。

即将发行。

Answered my own question. 回答了我自己的问题。

I tried to replicate the problem instead of waiting for it to happen again and I found that this was occuring because I was filtering data in the table, and then sorting it. 我试图复制问题,而不是等待它再次发生,我发现这是因为我正在过滤表中的数据,然后对其进行排序。 The reason numbers are so random is that the filter would grab only a handful of rows from thousands, and then sorting it would change the cell reference. 原因数字如此随机,以至于过滤器将仅捕获数千行中的少数几行,然后对其进行排序将更改单元格引用。

With that being said, I believe this post is now a copy of the following: How do I sort a table in Excel if it has cell references in it? 话虽这么说,我相信这篇文章现在是以下内容的副本: 如果Excel中有单元格引用,如何对表进行排序?

One way to get around this, is to use Excel's built in tables feature. 解决此问题的一种方法是使用Excel的内置表格功能。 With this much data it may not be feasible, but one benefit, is that when you have a formula it doesn't reference the row number, it instead just has the formula use the data in the same row as the formula. 拥有这么多数据可能并不可行,但是一个好处是,当您拥有一个公式时,它不引用行号,而是让公式使用与公式在同一行中的数据。

Not very clear. 不太清楚。 Let's try again 让我们再试一次

I have a table 我有桌子

col1    col2    col3
1       2
2       4

in col3 I want a sum of the items of the same row in col1 and col2. 在col3中,我想要col1和col2中同一行的项目总和。

Without the table feature in Excel I would have the following formulas in the table 没有Excel中的表格功能,表格中将包含以下公式

=A2+B2
=A3+B3

With the table feature in Excel the formula looks like this. 使用Excel中的表格功能,公式如下所示。

=[col1]+[col2]
=[col1]+[col2]

The formula is the same for all rows, and the table knows to use the same row of data. 所有行的公式均相同,并且该表知道使用同一行数据。

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

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