在Google表中的日期列表之间自动填充日期,并与其他列链接

发布于 2025-02-07 06:32:24 字数 895 浏览 3 评论 0原文

我有一个电子表格列出何时员工请求离开业务。

我可以使用哪种公式根据馈送到电子表格中的数据来生成以下输出?

我需要:

  • 要生成单独的行以显示员工不在的每个个人日子,链接到其名称的
  • 列表中,将所有员工包括在列表中

“所需的输出”

这是一个 sample everalsheet 包含我已经组合在一起的数据。不幸的是,我遇到的唯一日期之间的自动填充是:

=ArrayFormula((TO_DATE(row(indirect("A"&Input!B2):indirect("A"&Input!C2)))))

但是,这也不是列A列的内容,并且一次不会处理大量数据。

I have a spreadsheet that lists when an employee requests leave away from the business.

Data feed input

What formula can I use to produce the below output based on the data fed into the spreadsheet please?

I require:

  • Separate rows to be generated to show each individual day that the employee is off for, linked to their name
  • The list to include all employees in the list

Desired required output

This is a Sample Spreadsheet containing the data I have put together. Unfortunately the only formula I have come across that autopopulates between dates is:

=ArrayFormula((TO_DATE(row(indirect("A"&Input!B2):indirect("A"&Input!C2)))))

however, this does not also bring across the contents of Column A and does not process numerous rows of data at a time.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

星星的轨迹 2025-02-14 06:32:24

尝试:

=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(IF(DAYS(C2:C10, B2:B10)+1>=
 SEQUENCE(1, MAX(DAYS(C2:C10, B2:B10))), A2:A10&"×"&B2:B10+
 SEQUENCE(1, MAX(DAYS(C2:C10, B2:B10)), 0), )), "×"), "where Col2>0", ))

Try:

=ARRAYFORMULA(QUERY(SPLIT(FLATTEN(IF(DAYS(C2:C10, B2:B10)+1>=
 SEQUENCE(1, MAX(DAYS(C2:C10, B2:B10))), A2:A10&"×"&B2:B10+
 SEQUENCE(1, MAX(DAYS(C2:C10, B2:B10)), 0), )), "×"), "where Col2>0", ))

enter image description here

简美 2025-02-14 06:32:24

一种方法是使用sequence(),如下:

=arrayformula( 
  query( 
    split( 
      flatten( 
        if( 
          ( D2:D <= sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) )
          *
          ( E2:E >= sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) ), 
          A2:A & "→" & trim( to_date( sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) ) ), 
          iferror(1/0) 
        ) 
      ), 
      "→", false, true 
    ), 
    "where Col2 is not null", 0 
  ) 
)

One way to do that is with sequence(), like this:

=arrayformula( 
  query( 
    split( 
      flatten( 
        if( 
          ( D2:D <= sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) )
          *
          ( E2:E >= sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) ), 
          A2:A & "→" & trim( to_date( sequence( 1, max(D2:E) - min(D2:E) + 1, min(D2:E) ) ) ), 
          iferror(1/0) 
        ) 
      ), 
      "→", false, true 
    ), 
    "where Col2 is not null", 0 
  ) 
)
萌辣 2025-02-14 06:32:24

另一个:

= arrayformula(ifError(query(split(flatten)(filter(a2:a&amp;“〜”〜”&amp; if(((b2:b+sequence(1,60)))&gt; c2:c ,, b2: b+序列(1,60)),a2:a&lt;&gt;“”)),“〜”,1,0),“ select * whene col2不为null”),{“”,“”,“})))))))))

这将最多可容纳60天。您只需将两个实例的60设置为每人最大的连续天数。

Another:

=ArrayFormula(IFERROR(QUERY(SPLIT(FLATTEN(FILTER(A2:A&"~"&IF((B2:B+SEQUENCE(1,60))>C2:C,,B2:B+SEQUENCE(1,60)),A2:A<>"")),"~",1,0),"Select * WHERE Col2 Is Not Null"),{"",""}))

This will handle up to 60 days off at a time. You can just set the two instances of 60 to your maximum number of contiguous days off per person.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文