excel表格中如何根据一个单元格中的一定范围内时间段,在另一个单元格显示相应文字呢?
比如说,在大于等于17:00:00小于19:30:00时,显示“晚高峰”,在大于10:30:00小于13:00:00时,显示“午高峰”,23:00-6:30时显示“凌晨”...
比如说,在大于等于17:00:00小于19:30:00时,显示“晚高峰”,在大于10:30:00小于13:00:00时,显示“午高峰”,23:00-6:30时显示“凌晨”这样的,怎么设置?
展开
6个回答
展开全部
你时间格式是标准格式吗?如果是,假设A1是标准时间格式的数值,B1输入公式:
=IF(AND(A1>=17/24,A1<=19.5/24),"晚高峰",IF(AND(A1>=10.5/24,A1<=13/24),"午高峰",IF(OR(A1>=23/24,A1<=6.5/24),"凌晨")))
PS:你的午高峰应当是定义错误的吧。
=IF(AND(A1>=17/24,A1<=19.5/24),"晚高峰",IF(AND(A1>=10.5/24,A1<=13/24),"午高峰",IF(OR(A1>=23/24,A1<=6.5/24),"凌晨")))
PS:你的午高峰应当是定义错误的吧。
追答
=IF(AND(A1>=17/24,A1=10.5/24,A1<=13/24),"午高峰",IF(OR(A1<=23/24,A1=6.5/24),"凌晨","")))
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
在B1中输入或复制粘贴下列公式
=IF(AND(A1>=17/24,A1<=19.5/24),"晚高峰",IF(AND(A1>=10.5/24,A1<=13/24),"午高峰",IF(OR(A1>=23/24,A1<=6.5/24),"凌晨","")))
或
=LOOKUP(A1,{0,6.5,10.5,13,17,19.5,23}/24,{"凌晨","","午高峰","","晚高峰","","凌晨"})
下拉填充
=IF(AND(A1>=17/24,A1<=19.5/24),"晚高峰",IF(AND(A1>=10.5/24,A1<=13/24),"午高峰",IF(OR(A1>=23/24,A1<=6.5/24),"凌晨","")))
或
=LOOKUP(A1,{0,6.5,10.5,13,17,19.5,23}/24,{"凌晨","","午高峰","","晚高峰","","凌晨"})
下拉填充
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询