我正在尝试优先查看一个单元格(M2),确定哪一年在该日期,然后用当年填充我当前的单元格(N2)。以下是我目前的代码,它不起作用。
= if(M2 =年(2017)," 2017",如果(M2 =年(2018)," 2018",如果(M2 =年(2019),& #34; 2019"," 2017年之前")))
答案 0 :(得分:0)
=IF(YEAR(M2) = 2017,2017,IF(YEAR(M2) = 2018,2018,IF(YEAR(M2) = 2019,2019, "Before 2017")))
或更好
=IF(YEAR(M2)<2017,"Before 2017",YEAR(M2))