【发布时间】:2022-10-14 02:56:01
【问题描述】:
问题:
给定一个支付周期和销售日期的列表。对于每个销售日期,确定下一个发薪日。
| Pay periods (given) | Sale date (given) | Pay day (To be generated) |
|---|---|---|
| June 4 | June 4 | June 4 |
| June 17 | June 4 | June 4 |
| June 30 | June 4 | June 4 |
| July 15 | June 5 | June 17 |
| June 5 | June 17 | |
| June 12 | June 17 | |
| June 16 | June 17 | |
| June 18 | June 30 | |
| June 22 | June 30 | |
| June 24 | June 30 | |
| June 28 | June 30 | |
| June 30 | June 30 | |
| July 1 | July 15 | |
| July 7 | July 15 | |
| July 8 | July 15 | |
| July 9 | July 15 | |
| July 10 | July 15 |
Google Sheets: Yellow = given data, Blue = answer to be generated
我得到的最近的:
=arrayformula(过滤器($A$2:$A,abs($A$2:$A-B2)=min(abs($A$2:$A-B2))))
这个公式是不正确的,因为对于某些销售日期,发薪日更早。销售日期必须始终在发薪日之前,因为在现实生活中,您只有在完成销售后才能获得报酬,而不是之前。
【问题讨论】:
标签: google-sheets google-sheets-formula