英文:
Consolidate values of a row into a cell and repeating the process down a column using a single formula
问题
在一列中,我想要将一行中的所有数值合并,以顶部或最左侧的列标题名称分隔。我希望这个公式是一个单列公式,可以处理从一列到第500行。在Excel中,这将利用ArrayFormula,但由于这是Excel,我不知道如何将这个解决方案处理为一个单一的公式,而不必拖动/填充或使用自定义表格。
请查看下面的图片,我将在这里链接表格。
英文:
In a column, I want to consolidate all the values in a row separated by the top or top-left-most column header name. I want the formula to be a single column formula that process down a column or up to row 500. In Google Sheets, this would utilize an ArrayFormula, but since this is Excel, I don't know how to process this solution as a single formula without having to drag down/fill down or use custom table.
See image below and I will link to the sheet here.
答案1
得分: 3
以下是翻译好的部分:
连接数据
=LET(table,E4:M8,IgnoreNoCat,1,ShowNoMatch,0,
hDel,CHAR(10)&CHAR(10),hdDel,CHAR(10),dcDel,", ",
hd,TAKE(table,1),dd,DROP(table,1),
h,SCAN("",hd,LAMBDA(a,v,IF(v<>"",v,a))),
hu,UNIQUE(h,1),
br,BYROW(dd,LAMBDA(r,LET(
bc,BYCOL(hu,LAMBDA(c,LET(
jd,TEXTJOIN(dcDel,IgnoreNoCat,FILTER(r,h=c)),
IF(LEN(jd)=0,IF(ShowNoMatch,c,""),c&hdDel&jd)))),
TEXTJOIN(hDel,,bc)))),
br)
英文:
Join Data
=LET(table,E4:M8,IgnoreNoCat,1,ShowNoMatch,0,
hDel,CHAR(10)&CHAR(10),hdDel,CHAR(10),dcDel,", ",
hd,TAKE(table,1),dd,DROP(table,1),
h,SCAN("",hd,LAMBDA(a,v,IF(v<>"",v,a))),
hu,UNIQUE(h,1),
br,BYROW(dd,LAMBDA(r,LET(
bc,BYCOL(hu,LAMBDA(c,LET(
jd,TEXTJOIN(dcDel,IgnoreNoCat,FILTER(r,h=c)),
IF(LEN(jd)=0,IF(ShowNoMatch,c,""),c&hdDel&jd)))),
TEXTJOIN(hDel,,bc)))),
br)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论