使用偏移量/计数但带有扭曲的动态命名范围

时间:2019-02-06 14:08:28

标签: excel dynamic range offset named

im从仅1列的动态命名范围创建自动更新数据透视表。该范围的数据在其下方和上方。是否可以使用偏移量公式来具有动态命名范围,但起始点/终止点是触发字/文本?例如

don't look here
don't look here
don't look here
don't look here
trigger text (not included in named range)
data
data
data
(insert more data here)
data
data
(insert more data here)
data
trigger text (not included in named range)
don't look here
don't look here
don't look here

我想要的动态命名范围是“数据”所在的位置。起点和终点都是动态的。您如何确定此公式以适应这种需求?

= OFFSET(Sheet2!$ A $ 2,0,0,COUNTA(Sheet2!$ A:$ A)-1,1)

在我的示例中,起点是$ A89,但明天可能是$ A91。端点的类似情况

类似 = offset(sheet2!(触发词1下方1个单元格),0,0,counta(sheet2!$ A :(触发词2上方1个单元格)x,x)

2 个答案:

答案 0 :(得分:2)

如果触发文本可以不同,则以1开头,以不同的结尾结束:

 =INDEX(Sheet2!$A:$A,MATCH("BeginTrigger",Sheet2!$A:$A,0)+1):INDEX(Sheet2!$A:$A,MATCH("EndTrigger",Sheet2!$A:$A,0)-1)

答案 1 :(得分:0)

这基于两个不同的触发文本:

=OFFSET(Sheet1!$A$2,MATCH("trigger1",Sheet1!$A:$A,0),0,MATCH("trigger2",Sheet1!$A:$A,0)-MATCH("trigger1",Sheet1!$A:$A,0)-1,1)