gpt4 book ai didi

excel - 满足条件(日期)时将各种事件合并到一个单元格中 google sheet

转载 作者:行者123 更新时间:2023-12-04 20:22:16 26 4
gpt4 key购买 nike

再会!
我正在寻求您的帮助。得出以下输出的正确公式是什么?先感谢您。

Data
Ref Activity 1 Activity 2 Activity 3
001 23-Oct-2021 25-Oct-2021 5-Nov-2021
002 25-Oct-2021 30-Oct-2021 5-Nov-2021
003 25-Oct-2021 5-Nov-2021 6-Nov-2021

Output
23-Oct-2021
001 - Activity 1

25-Oct-2021
001 - Activity 2
002 - Activity 1
003 - Activity 1

最佳答案

尝试:

=INDEX(QUERY(FLATTEN(SPLIT(QUERY(FLATTEN(TRANSPOSE(QUERY(SPLIT(FLATTEN(
IF(B2:D="",," ♣"&TO_TEXT(B2:D)&"♦"&A2:A&" - "&B1:D1)), "♦"),
"select max(Col2) where Col2 is not null group by Col2 pivot Col1"))),
"where Col1 is not null"), "♣")),
"where Col1 is not null offset 1", 0))
enter image description here

更新:
=INDEX(SUBSTITUTE(SUBSTITUTE(TRIM(TRANSPOSE(SPLIT(FLATTEN(
QUERY(SUBSTITUTE(QUERY(SPLIT(FLATTEN(
IF(C4:E6="",,TO_TEXT(C4:E6)&"♠♣♦"&B4:B6&" - "&C3:E3)), "♦"),
"select max(Col2) where Col2 is not null group by Col2 pivot Col1"),
" ", CHAR(13)),,9^9)), "♣"))), " ", CHAR(10)), "♠", ))
enter image description here

关于excel - 满足条件(日期)时将各种事件合并到一个单元格中 google sheet,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69687373/

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