根据以下条件要求的Excel公式:
条件:
After Date after 31/07/2017
Before Date after 12/10/2016 & Before 01/08/2017
Old Date after 12/10/2015 & Before 12/10/2016
Very Old Date Before 12/10/2015
输出如下
Date Status
12-03-2014 Very Old
10-03-2015 Very Old
11-02-2016 Old
05-05-2016 Old
22-12-2016 Before
25-01-2017 Before
28-02-2017 Before
20-03-2017 Before
19-06-2017 Before
20-07-2017 Before
21-07-2017 Before
10-08-2017 After
25-08-2017 After
29-08-2017 After
01-09-2017 After
08-09-2017 After
请帮忙 CSGanesh
答案 0 :(得分:2)
创建一个包含开始日期和预期结果的表格:
然后使用VLOOKUP()
=VLOOKUP(D2,A:B,2,TRUE)
如果您不想使用表格但需要硬编码公式,那么:
=CHOOSE(MATCH(D2,{0,42289,42655,42947}),"Very Old","Old","Before","After")
{0,42289,42655,42947}
是一般格式的日期,可以用引号中的实际日期替换; {"1/0/1900","12/10/2015",...}
答案 1 :(得分:0)
我会使用嵌套if if statment这里是一个链接:
https://exceljet.net/formula/nested-if-function-example
这里是前两个条件,excel可以解释时间间隔,因此用条件锁定一个单元格,然后拖动公式。请记住验证单元格确实是日期。
IF(日期< 12/10/15,"非常老",IF(AND(D6> 12/10/15,日期< 12/10/16)," old&# 34;,0))