我收到了一个包含两列的工作表:日期和周列。
我想要做的是创建一个具有该特定周的日期范围(最小和最大)的附加列。
例如:
+-----------+--------+-------------------+
| Date | Week | Date Range |
+-----------+--------+-------------------+
| 8/1/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/2/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/3/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/4/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/5/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/6/2017 | Week 1 | 8/1/17 - 8/6/17 |
| 8/7/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/8/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/9/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/10/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/11/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/12/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/13/2017 | Week 2 | 8/7/17 -8/13/17 |
| 8/14/2017 | Week 3 | 8/14/17 - 8/20/17 |
+-----------+--------+-------------------+
逻辑是:找到周等于的最小和最大日期。
我尝试使用这个公式,但它没有按预期工作......
=TEXT(INDEX(MIN($A$2:$A$15), MATCH($B$2:$B$15,$B$2:$B$15, 0)),"mm/dd/yy") & " - " & TEXT(INDEX(MAX($A$2:$A$15), MATCH($B$2:$B$15, $B$2:$B$15, 0)), "mm/dd/yy")