最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Google Sheets - Use an array to check the date then display a table - Stack Overflow

programmeradmin0浏览0评论

I am trying to get an ARRAYFORMULA to check column A for today's date, then display a 9-row table, but because the array continues, it only shows the first row. Is there any way to move the data over so as not to interfere with the array or stop the array after it finds today's date?

=ARRAYFORMULA(IF(A721:A=TODAY(),ARRAYFORMULA($T$12:$Y$20),))

I tried using {"",ARRAYFORMULA($T$12:$Y$20}, but that only allows for one row.

I am trying to get an ARRAYFORMULA to check column A for today's date, then display a 9-row table, but because the array continues, it only shows the first row. Is there any way to move the data over so as not to interfere with the array or stop the array after it finds today's date?

=ARRAYFORMULA(IF(A721:A=TODAY(),ARRAYFORMULA($T$12:$Y$20),))

I tried using {"",ARRAYFORMULA($T$12:$Y$20}, but that only allows for one row.

Share Improve this question edited Feb 7 at 19:14 President James K. Polk 42k27 gold badges109 silver badges144 bronze badges asked Feb 5 at 18:56 Steve S.Steve S. 31 bronze badge 3
  • Welcome to StackOverflow! Please provide a minimal reproducible example in the form of markdown tables containing your sample input data and desired output. You may create one with the help of this link. – Jats PPG Commented Feb 5 at 19:02
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Bot Commented Feb 5 at 19:09
  • Make sure to provide input and expected output as plain text table in the question. Check my answer or other options to create a table easily, which are easy to copy/paste. Avoid sharing links like spreadsheets, which make the question useless for others or images, which are hard to copy. Also, note that your email address can also be accessed by the public, if you share Google files. – TheMaster Commented Feb 6 at 0:18
Add a comment  | 

1 Answer 1

Reset to default 0

Use vstack(), like this:

=let( 
  range, T12:Y20, 
  offset, xmatch(today(), A721:A) - 1, 
  filler, iferror( 
    makearray(offset, columns(range), 
      lambda(r, c, iferror(ø))
    ), 
    tocol(æ, 2) 
  ), 
  if(iserror(offset), 
    iferror(ø), 
    vstack( 
      filler, 
      range 
    ) 
  ) 
)

The formula should go to row 721 in a free column that has an additional five free columns on the right so that there is room for the results the array formula returns.

See let(), xmatch(), iferror(), makearray(), tocol() and vstack().

发布评论

评论列表(0)

  1. 暂无评论