简体   繁体   English

Excel 搜索范围并返回对应的列号

[英]Excel search range and return corresponding column number

I am trying to make my excel document search a range and return the table value of every incidence.我试图让我的 excel 文档搜索一个范围并返回每个事件的表值。 In the picture below , I am trying to enter a formula in the leftmost (green) cell that will search the table (bold outline) for all instances of "Piercing", then return the position of each instance (The corresponding number in the blue row) as a list.在下图中,我试图在最左侧(绿色)单元格中输入一个公式,该公式将在表格(粗体轮廓)中搜索“穿孔”的所有实例,然后返回每个实例的 position(蓝色中的相应数字行)作为列表。 What I have in the green cell is what I'd like it to look like.我在绿色单元格中拥有的是我希望它看起来的样子。 If necessary, I'm ok with it not showing duplicate entries and instead just showing where one of the instances is.如有必要,我可以不显示重复条目而只显示其中一个实例的位置。

Try below formula-试试下面的公式 -

=TEXTJOIN(",",TRUE,FILTER(C1:L1,MMULT(SEQUENCE(1,ROWS(C2:C4),,0),--((C2:L4="Piercing")))))

And if you have BYCOL() function then could try-如果你有BYCOL() function 那么可以试试 -

=TEXTJOIN(",",TRUE,FILTER(C1:L1,BYCOL(C2:L20000,LAMBDA(x,MAX(--(x="Piercing"))))))

在此处输入图像描述

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

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