多个匹配得到最坏的结果
所以我很难搞清楚我应该用什么来报告。 我知道它应该是一个嵌套的,但我真的不知道该怎么去做。 我需要确定是否有什么东西:
Delivered Called Out Partially Called Out Forecasted Partially Ordered Not Ordered (this would simply be, if no matches, it wasn't ordered)
问题是可以有多个具有相同ID号码的订单(导致每个ID都有很多部分)。 所以我需要的是一个方法来看看所有相同的ID号码,并给我最糟糕的结果。 例如,如果我有4个相同的ID与结果:
Delivered Delivered Partially Called Out Partially Ordered
公式的结果会给我“部分有序”,因为这是最糟糕的结果。
所以基本上,我正在从多个相同的ID寻找最糟糕的订单状态结果
我开始
=IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))=0,"Not Ordered",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Partially Ordered","Partially Ordered",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Forecasted","Forecasted",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Partiially Called Out","Partially Called out",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Called Out","Called Out",IF(INDEX([Report.xlsx]Report!$G:$G,MATCH(B2,[Report.xlsx]Report!$K:$K,0))="Delivered","Delivered"))))))
但是,这不是让我find我正在寻找,我相当肯定有一个更好的办法…
使用这样一个数组公式:
=IF(ISNUMBER(MATCH(D2,A:A,0)),INDEX(I:I,MAX(IF($A$2:$A$23=D2,IFERROR(MATCH($B$2:$B$23,I:I,0),0)))),"Not Ordered")
作为一个数组公式,在退出编辑模式而不是Enter时,需要用Ctrl-Shift-Enter确认。 如果正确完成,则Excel将在公式周围放置{}
。
这假定列表是按照从最好到最差的状态。