如间在Excel判断时间并这样显示呢?
发布网友
发布时间:2022-05-10 05:26
我来回答
共3个回答
热心网友
时间:2023-11-05 19:21
设日期时间在列,A1时间是2010-6-5 18:30:00,在B1输入公式:
=TEXT(A1,"yyy年mm月dd日")&" "&LOOKUP(HOUR(A1),{0,"上午";12,"下午";18,"晚上"})&" "&TEXT(WEEKDAY(A1),"aaaa")
这里以18点后为晚上,至于实际情况LZ可自行修改。
热心网友
时间:2023-11-05 19:21
加入一列,比如A1是时间2010-6-5 20:30:00
在B1写
=TEXT(A1,"yyyy年mm月dd日")&" "&IF(HOUR(A1)<12,"上午",IF(HOUR(A1)<19,"下午","晚上"))&" "&TEXT(WEEKDAY(A1),"aaaa")
热心网友
时间:2023-11-05 19:22
WEEKDAY是多余的
=TEXT(A1,"yyyy年mm月dd日")&" "&IF(HOUR(A1)<12,"上午",IF(HOUR(A1)<19,"下午","晚上"))&" "&TEXT(A1,"aaaa")