Google Excel 日期跨越两列

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

Google Excel Date to Span two columns

问题

2023
七月
任务 周六 周日 周一 周二 周三
ABC 01 02 03 04 05

阅读
音乐
绘画

上面的Excel生成了每月的日期。现在,对于第一列中的每个任务,我需要在日期下面有两列,因为有两个人需要更新状态(ABC、DEF类型)。

因此,每个日期必须跨越两列。我用于生成日期的公式是:

=LET(dt,DATE(A1,MONTH(A2&1),1),IF(LEN(A1),SEQUENCE(1,EOMONTH(dt,0)-dt+1,dt),))

英文:
2023					
Jul					
Tasks	Sat	Sun	Mon	Tue	Wed
ABC	    01	02	03	04	05
					
Reading					
Music					
Drawing		

The above excel generates the monthly dates. Now for each of tasks in column 1 I need to have 2 columns under date as two people need to update the status. (ABC, DEF) types.

So each date has to span across two columns. The formula I am using for date generation is:

=LET(dt,DATE(A1,MONTH(A2&1),1),IF(LEN(A1),SEQUENCE(1,EOMONTH(dt,0)-dt+1,dt),))

答案1

得分: 3

以下是翻译好的部分:

有很多思考方式之一是创建一个两倍天数的序列,但每次添加“半天”。由于您随后会根据需要格式化单元格,所以这12小时将被忽略:

=LET(dt,DATE(A1,MONTH(A2&1),1),IF(LEN(A1),SEQUENCE(1,2*(EOMONTH(dt,0)-dt+1),dt,0.5),))

另一种方法是复制并将数组作为一行获取:

=LET(dt,DATE(A1,MONTH(A2&1),1),
days,SEQUENCE(1,EOMONTH(dt,0)-dt+1,dt),
IF(LEN(A1),TOROW({days;days},,1),))

您还可以复制并排序,还有其他方法!

英文:

There are many ways of thinking it. One is to create a sequence of twice the amount of days, but adding "half a day" each time. Since you'll then format the cell as needed, the 12 hs will be despicable:

=LET(dt,DATE(A1,MONTH(A2&1),1),IF(LEN(A1),SEQUENCE(1,2*(EOMONTH(dt,0)-dt+1),dt,0.5),))

Other is to duplicate and get the array as a row:

=LET(dt,DATE(A1,MONTH(A2&1),1),
days,SEQUENCE(1,EOMONTH(dt,0)-dt+1,dt),
IF(LEN(A1),TOROW({days;days},,1),))

You could duplicate and sort, and other ways too!

huangapple
  • 本文由 发表于 2023年7月20日 11:58:32
  • 转载请务必保留本文链接:https://go.coder-hub.com/76726582.html
匿名

发表评论

匿名网友

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

确定