简体   繁体   English

MS Excel。 删除部分公式,该公式在整个单元格范围内都会变化

[英]MS Excel. Remove part of formula which varies throughout a range of cells

I had this problem: I wanted to delete part of formula which varied across a range of cells ( E12, E13, E14, .. ) so I wasn't able to use "Find and replace". 我遇到了这个问题:我想删除部分公式(在E12, E13, E14, ..范围内变化),因此无法使用“查找并替换”。 Specifically, I wanted to delete the second VLOOKUP function from the formula below and replace "Month7-15" with "Month6-15": 具体来说,我想从下面的公式中删除第二个VLOOKUP函数,并将“ Month7-15”替换为“ Month6-15”:

Formula to edit: 要修改的公式:

= IFERROR(VLOOKUP(E12, 'Month7-15'!$A$5:$B$353, 2, FALSE) - VLOOKUP(E12, 'Month7-15'!$A$5:$B$353, 3, FALSE), "no data")

Same guy as above 与上述相同

  1. Firstly, in the initial Excel workbook, I hit Ctrl + H on the selected column (same applies to row) and replaced "Month7-15" with "Month6-15" 首先,在初始的Excel工作簿中,我在选定的列上按了Ctrl + H(对行同样适用),并将“ Month7-15”替换为“ Month6-15”
  2. Secondly, with the column selected, I hit Ctrl + Tilde, copied and paste the formulas in Notepadd++ 其次,选中该列,然后按Ctrl + Tilde,将公式复制并粘贴到Notepadd ++中
  3. Thirdly, in Notepad++, i found and replaced "=" with "", so I won't have any equal signs and copied the results to a new Excel workbook. 第三,在Notepad ++中,我找到了“ =”并替换为“”,因此我不会有任何等号并将结果复制到新的Excel工作簿中。
  4. Next, in this Excel workbook I used REPLACE function and declared its parameters such as my second VLOOKUP function will be deleted. 接下来,在此Excel工作簿中,我使用了REPLACE函数,并声明了其参数,例如我的第二个VLOOKUP函数将被删除。 Because my range of cells was so big, this REPLACE didn't work after index exceeded row 100 - so, I had FALSEE instead of FALSE . 由于我的单元格范围很大,因此在索引超过第100行后,此REPLACE无法正常工作-因此,我使用FALSEE而不是FALSE I solved this in the next point. 接下来,我解决了这个问题。
  5. From Excel, I copied the edited quasi-functions, pasted them in Notepad++. 我从Excel复制了已编辑的准功能,并将其粘贴到Notepad ++中。 I introduced the equal sign by find and replace: "IFERR" with "= IFERR". 我通过查找并用“ = IFERR”替换“ IFERR”来引入等号。 I solved the issue of FALSEE by find and replace to FALSE 我通过查找并替换为FALSE解决了FALSEE的问题
  6. Lastly, I copied the functions from Notepad++ to the initial Excel workbook and it saved me hours of work of replacing manually the undesired part of formula in the function. 最后,我将这些功能从Notepad ++复制到了初始的Excel工作簿中,这为我节省了手动替换功能中不需要的公式部分的工作时间。

NB. 注意 I couldn't just use one formula to drag it down as many rows I had because I had different references as well as hard-coded values for some rows. 我不能只使用一个公式将其向下拖动到我拥有的许多行中,因为我有不同的引用以及某些行的硬编码值。

Hope this helps people. 希望这对人们有所帮助。

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

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