Excel电子表格使用值表来覆盖单元格

我想写一个excel函数,它将用表中的值replace一些包含文本的单元格。 单元格中的文本与表格对应。

例如: 在这里输入图像说明

在这里我有我想要replace/覆盖的单元格。 我想使用Table of values for matchingTable of values for matching以匹配我的text1_1Table of values for replacement (1,1)处Table of values for replacement的新newtext ,依此类推。

我怎样才能做到这一点?

我所做的是我做了以下工作:

  1. 我知道text1_1是在cell to replace中的第1列cell to replace表格。
  2. 所以,我知道text1_1将在第一行Table of values for matching ,我只需要在那里find列。
  3. 有一次,我把表中的行号r和列号c Table of values for matching ,然后我可以用值Table of values for replacementr – 位移c )来代替我的text1_1中的Cells to replace

有可能有比我想象的更有效的解决scheme,所以在这种情况下,我很乐意看到它。

我应该使用哪些function? 如果没有直接的办法,那么有人可以给我一些指导吗?

这是一个build议,假设我正确理解你的问题。

正如在评论中提到的,没有办法将公式放置在使用同一单元格内容的单元格中,因为它已经包含公式。 你可以做的是创build一个新的表来获取所有基于Table of values for matching Table of values for matching 。 但是,我假设(在你的例子中)你知道在哪个列/行中查找表格。 在你的例子中, cell to replacecell to replace的列号是要在Table of values for matching查看的行号以Table of values for matching ,所以我的解决scheme适合这种情况。 尽pipe如此,只要你现在在哪个列/行看,你可以很容易地编辑它以适应另一个需要。 所以让我们开始:

  1. 创build一个与cell to replace匹配的新表cell to replace表中的大小。
  2. 在最左上angular的单元格中粘贴以下公式: =INDEX($G$3:$M$6,A$10,MATCH(A3,OFFSET($G$10:$M$10,A$10-1,0),0))
  3. 将此公式拖到所有其他单元格中,您将看到与值Table of values for replacement匹配的新值以Table of values for replacement

替换匹配的文本

告诉我,如果它回答你的问题;)