如何用Excel把时间分段
发布网友
发布时间:2022-05-01 17:47
我来回答
共2个回答
热心网友
时间:2022-06-20 13:15
请问22点整你要求算在哪个时间段?
20:00:00-22:00:00?
22:00:00-24:00:00?
如果用上一个使用
=VLOOKUP(VALUE(A2),{0.0000115740740740741,"0-2";0.0833449074074074,"2-4";0.166678240740741,"4-6";0.250011574074074,"6-8";0.333344907407407,"8-10";0.416678240740741,"10-12";0.500011574074074,"12-14";0.583344907407407,"14-16";0.666678240740741,"16-18";0.750011574074074,"18-20";0.833344907407407,"20-22";0.916678240740741,"22-24";0.999988425925926,"22-24"},2,1)
只有下半夜0:00:01出现浮点错误,其它都正确
热心网友
时间:2022-06-20 13:15
B2单元输入:
=IF(MOD(HOUR(A2),2),HOUR(A2)-1&":00-"&HOUR(A2)+1&":00",HOUR(A2)&":00-"&HOUR(A2)+2&":00")
下拉公式