答案 0 :(得分:1)
由于您的时间是文本,看起来像我们需要转换它们的时间。
我们可以使用两个嵌套的SUBSTITUTES在公式中执行此操作。
要获得MIN和MAX,我们将使用AGGREGATE公式。
MIN:
=AGGREGATE(15,6,SUBSTITUTE(SUBSTITUTE($D$2:$D$7,"AM"," AM"),"PM"," PM")/($A$2:$A$7=A12),1)
MAX:
=AGGREGATE(14,6,SUBSTITUTE(SUBSTITUTE($F$2:$F$7,"AM"," AM"),"PM"," PM")/($A$2:$A$7=A12),1)
您可以对数组公式MIN(IF())和MAX(IF())执行相同的操作。
=MIN(IF($A$2:$A$7=A12,--SUBSTITUTE(SUBSTITUTE($D$2:$D$7,"AM"," AM"),"PM"," PM")))
=MAX(IF($A$2:$A$7=A12,--SUBSTITUTE(SUBSTITUTE($F$2:$F$7,"AM"," AM"),"PM"," PM")))
由于它们是数组公式,因此在退出编辑模式时需要使用Ctrl-Shift-Enter而不是Enter来确认。如果操作正确,Excel会将{}
放在公式周围。
两组公式都将返回小数。需要将单元格格式化为正确的所需输出。