gpt4 book ai didi

Excel公式: Grab the column name corresponding to particular cell

转载 作者:行者123 更新时间:2023-12-04 20:11:31 25 4
gpt4 key购买 nike

Excel Sheet

在上面的 excel 表中,我需要一个公式来提取存在“1”的特定列名,然后在相应的单元格中输入该名称。示例 - 在上面的图像中,对应于 col“Tags”的每一行都包含相应单元格包含“1”的列名。

最佳答案

对于 4 列示例,您可以使用以下命令:
=SUBSTITUTE(TRIM(IF(A2,$A$1,"")&" "&IF(B2,$B$1,"")&" "&IF(C2,$C$1,"")&" "&IF(D2,$D$1,""))," ",", ")
对于 7 列,只需添加额外的 IF TRIM 中的语句遵循相同的模式。

该公式依赖于 1=TRUE保持简短。结果每个IF后跟一个空格。 TRIM当没有 1 时去掉多余的空格发生。最后SUBSTITUTE转换 进入 ,所以你得到一个逗号分隔的列表。

注意:

TRIM strips extra spaces from text, leaving only single spaces between words and no space characters at the start or end of the text.



enter image description here

关于Excel公式: Grab the column name corresponding to particular cell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42217170/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com