Excel 创建空单元格并替换重复项

huangapple go评论56阅读模式
英文:

Excel create blank cells and replace duplicate

问题

我使用 FILTER 函数来自动填充我的数据。
可以自动创建空白单元格,然后替换重复的吗?
我已经搜索了几个小时,但无法弄清楚。提前谢谢。

这是我的示例:

A  1  SF
A  2  HK
B  3  SF
B  4  NYC
B  5  SF

使用 FILTER 函数仅返回包含“SF”的数据
=FILTER(A1:B5&"",C1:C5="SF")

A  1
B  3
B  5

我想要的结果:
在 A 和 B 之间创建一个空白单元格
使用“"”来替换重复的 B

A  1

B  3
"  5
英文:

I'm using the FILTER function to auto-fill my data.
It's possible to auto create blanks cells, and replace duplicate?
I've been googling for hours and can't figure this out. Thank you in advance.

Here is my example:

A  1  SF
A  2  HK
B  3  SF
B  4  NYC
B  5  SF

Using the FILTER function to return data only contain "SF"
=FILTER(A1:B5&"",C1:C5="SF")

A  1
B  3
B  5

The result I want:
create a blank cell between A and B
use " to replace the duplicate B

A  1

B  3
"  5

答案1

得分: 2

以下是翻译好的部分:

你可以使用这个公式:

=LET(data,A1:C5,uniqueLetters,UNIQUE(INDEX(data,,1)),
result,REDUCE("",uniqueLetters,LAMBDA(r,letter,VSTACK(r,"",FILTER(TAKE(data,,2),(INDEX(data,,3)="SF")*(INDEX(data,,1)=letter))))),
result1, DROP(result,2),
result2, MAP(result1,DROP(result,1),LAMBDA(a,b,IF(ISTEXT(a),IF(a=b,"",a),a))),
IFERROR(DROP(result2,-1),""))

result1 返回一个在字母之间插入空行的数组。

在下一步中,result1 与结果的第二个版本进行比较,该版本从“下一行开始”,以比较下一行中的相等值 - 如果是,则将字母替换为“”。

英文:

You can use this formula:

=LET(data,A1:C5,uniqueLetters,UNIQUE(INDEX(data,,1)),
result,REDUCE("",uniqueLetters,LAMBDA(r,letter,VSTACK(r,"",FILTER(TAKE(data,,2),(INDEX(data,,3)="SF")*(INDEX(data,,1)=letter))))),
result1, DROP(result,2),
result2, MAP(result1,DROP(result,1),LAMBDA(a,b,IF(ISTEXT(a),IF(a=b,"""",a),a))),
IFERROR(DROP(result2,-1),""))

result1 returns an array with an empty row inserted between the letters.

In the next step result1 is compared to second version of result that starts "one row later" to compare for equal values in the row below - if yes letter is replaced by "

Excel 创建空单元格并替换重复项

huangapple
  • 本文由 发表于 2023年6月15日 19:59:54
  • 转载请务必保留本文链接:https://go.coder-hub.com/76482247.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定