来自另一张纸的交叉参考文本和相邻单元格中的显示匹配

时间:2016-07-31 20:11:35

标签: excel vba excel-vba

我正在使用Excel 2010,并在Sheet 1上有一个操作表,如下所示:

**Actions**
Normal - No Action
Satifactory - No Action Required
Contact - Repeat In
Contact - Arrange Telecon With
Appointment Already Made
Ask Reception To
Already Dealt With
Letter Required

然后,我在表2中显示了分配给人员的这些操作的导入列表,如下面的A列所示,但是某些操作可能包含添加到每个操作结尾的其他自由文本(我在此仅突出显示)星号之间的例子:

**ACTION LIST**
Contact - Arrange Telecon With *ABCD*
Contact - Arrange Telecon With *efgh*
Appointment Already Made *17/07/2016*
Appointment Already Made *15/08/16*
Contact - Repeat In *2w*
Contact - Repeat In *3m*
Contact - Repeat In *1y*
Contact - Repeat In *6m*
Ask Reception To *Blah Blah*
Ask Reception To *Blah Blah Blah*
Satisfactory - No Action Required

我需要计算上面列表中有多少操作排除已添加到某些操作中的其他自由文本,以便结果在相邻单元格中显示如下:即B列:

**Action Outcome for Counting**
Contact - Arrange Telecon With
Contact - Arrange Telecon With
Appointment Already Made
Appointment Already Made
Contact - Repeat In
Contact - Repeat In
Contact - Repeat In
Contact - Repeat In
Ask Reception To
Ask Reception To
Satifactory - No Action Required

我可以使用Excel公式创建最后一个文本表吗? 公式是否可以将第1个表中的操作文本与第2个表的操作文本相匹配。 注意:第二个表中的Action文本将始终以第一个表中的文本开头,附加的freetext始终添加到Action的末尾。

我需要计算在第二个表中使用了多少个动作(在第一个表中)?

1 个答案:

答案 0 :(得分:0)

使用带搜索的数组形式的INDEX / MATCH比较子字符串:

=INDEX($E$1:$E$8,MATCH(TRUE,ISNUMBER(SEARCH( $E$1:$E$8,A1)),0))

我的行动清单位于E列。

作为数组公式,必须在离开编辑模式时使用Ctrl-Shift-Enter而不是Enter确认。如果操作正确,那么Excel会将{}放在公式周围。

enter image description here

相关问题