目标
=OFFSET(起始位置,1,0,最大数量,1)
起始位置:
indirect("Validate!"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"1") ' Validate!F1
获取下拉菜单所在列不为空的最大数量:
COUNTIF(A1:A15,"<>"&"")-1
A1:A15得到:INDIRECT("Validate!"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"1:"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"15")
进而:
COUNTIF(INDIRECT("Validate!"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"1:"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"15"),"<>"&"")-1
最终:
=OFFSET(indirect("Validate!"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"1"),1,0,COUNTIF(INDIRECT("Validate!"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"1:"&VLOOKUP(MATCH(E14,下拉菜单头,0),对照表,2,0)&"15"),"<>"&"")-1,1)
PS:
MATCH(E14,下拉菜单头,0) 获取下拉菜单头所在位置 0精确匹配