2017-02-21 83 views
0

我有一個帶有采購訂單的Excel表。例如:Excel:通過一組行中的鍵獲取特定值

order | order line | line status 
----------------------------------- 
1  | 1   | Received  
1  | 2   | Waiting 
2  | 1   | Received  

我需要與訂單的狀態添加的自動柱(用公式獲得):

order | order line | line status | order status 
------------------------------------------------------- 
1  | 1   | Received  | Waiting 
1  | 2   | Waiting  | Waiting 
2  | 1   | Received  | Received 

說明:

順序具有一個線收到和一行等待,所以公式必須返回等待,wh ich是整個訂單的狀態。當接收到線路,這兩條線將是接收狀態,所以由以下公式計算的順序的狀態必須爲接收

回答

1

使用COUNTIFS在IF:

=IF(COUNTIFS(A:A,A2,C:C,"Waiting"),"Waiting","Received") 

穿戴在D2中並抄下來。

enter image description here

+0

感謝您的非常快速的回答!我喜歡它,但我認爲它會起作用! – malvarez