我正在尝试创建一个动态表单,该表单将根据“年份中的第N个Dayday星期”(例如,“ 2018年1月的第3个星期一”)的格式返回日期。
这些是我的列表:
+-----+--------------+-----------+---------------+-------------------+-----------+-----------------+
| Row | (A) Instance | (B) Instance Value | (C) DayofWeek | (D) DayofWeek Value | (E) Month | (F) Month Value |
+-----+--------------+-----------+---------------+-------------------+-----------+-----------------+
| 1 | 1st | 0 | Monday | 1,0,6,5,4,3,2 | January | 1 |
| 2 | 2nd | 7 | Tuesday | 2,1,0,6,5,4,3 | February | 2 |
| 3 | 3rd | 14 | Wednesday | 3,2,1,0,6,5,4 | March | 3 |
| 4 | 4th | 21 | Thursday | 4,3,2,1,0,6,5 | April | 4 |
| 5 | Last | | Friday | 5,4,3,2,1,0,6 | May | 5 |
| 6 | | | Saturday | 6,5,4,3,2,1,0 | June | 6 |
| 7 | | | Sunday | 0,6,5,4,3,2,1 | July | 7 |
| 8 | | | | | August | 8 |
| 9 | | | | | September | 9 |
| 10 | | | | | October | 10 |
| 11 | | | | | November | 11 |
| 12 | | | | | December | 12 |
+-----+--------------+-----------+---------------+-------------------+-----------+-----------------+
我使用查找公式来获取返回的任何响应的值
+---------+----------------------------------+-----------------------------------+----+--------------------------------+----+-------+
| | Instance | DayofWeek | in | Month | of | Year |
+---------+----------------------------------+-----------------------------------+----+--------------------------------+----+-------+
| Name | 3rd | Monday | | January | | 2018 |
| Value | 14 | 1,0,6,5,4,3,2 | | 1 | | |
| Formula | =VLOOKUP(Instance,B2:C5,2,FALSE) | =VLOOKUP(DayofWeek,D2:E8,2,FALSE) | | =VLOOKUP(Month,F2:G13,2,FALSE) | | =year |
+---------+----------------------------------+-----------------------------------+----+--------------------------------+----+-------+
现在我正在尝试将这些值连接到公式中
= CONCATENATE(“ = date(”,year,“,”,Month,“,1)+”,Instance,“ + choose(weekday(Date(”,year,“,”,Month,“,1 ),)),“ ,, DayofWeek,”)“)
将生成一个包含此文本的单元格,该单元格看起来像公式,但不会运行。
=日期(2018,1,1)+14+选择(工作日(日期(2018,1,1),)),1,0,6,5,4,3,2)
是否可以运行此公式并通过从另一个单元格间接调用它来返回值?
我尝试过的其他事情:
之所以这样做,是因为我尝试了所有其他可以想到的方法,将CHOOSE数组复制到一个间接公式中,并且每次都被挫败。
我可以让这部分工作:
=DATE(year,Month,1)+Instance
这将显示数组
=INDIRECT("DayofWeek")
=N22&Chooseday solves as 43115+choose(weekday(Date(2018,1,1),)),1,0,6,5,4,3,2)
=DATE(year,Month,1)+occurrence+CHOOSE(WEEKDAY(DATE(year,Month,1),1),INDIRECT("G19"))
返回#VALUE!