2017-04-25 67 views
0

運行的每個不同對數(2列)我有一組值,我需要一個第三值(計數),在配對的最後一個不同實例放置1,如下:顯示在Excel

A  B Count 
apple 1  1 
apple 2  1 
apple 3  1 
plum 1  0 
plum 1  0 
plum 1  1 
plum 2  0 
plum 2  1 
plum 3  1 

這是可能在Excel中?我不能用這個數據做一個數據透視表,「count」列將用於其他目的。謝謝。

回答

2

使用該IF/OR:

=IF(OR(A2<>A3,B2<>B3),1,0) 

enter image description here

1

嘗試此公式中示出的圖像中,並且將其向下拖動,

=IF(COUNTIFS($A2:$A$10,A2,$B2:$B$10,B2)=1,1,0)

enter image description here