1

I have some data as follow (column A:D contain data, column E is the sum I created):

NO              
SE  

Date        Country ID  Value   Sum
30-01-2014  SE  B-08888 10  10  
05-02-2014  SE  B-08888 23      
06-02-2014  SE  B-08888 20      
13-05-2014  SE  B-08888 17  27  
14-05-2014  SE  B-08888 10      
13-05-2014  NO  A-07777 15  35  
14-05-2014  NO  A-07777 20      

I would like to sum all values that are having same country and same ID when: 1) the date is greater than 1/5; and 2) when date is less than 1/5.

I am using the SUMIFS. But the SUMIFS doesn't give correct results when I included the date argument which is less than 1/5.

=SUMIFS($D$5:$D$11;$A$5:$A$11;"<="&DATE(2014;5;1);$B$5:$B$11;A2;$C$5:$C$11;C5) ==> gives incorrect result (=10)

=SUMIFS($D$5:$D$11;$A$5:$A$11;">="&DATE(2014;5;1);$B$5:$B$11;A2;$C$5:$C$11;C8) ==> gives correct result (=27)

Is there a way I can take into account both date conditions (i.e. date greater than and less than 1/5) and make the formula general so I don't have to go through every cell to change reference?

Thank you.

4

1 に答える 1

0

あなたのデータを使用すると、2番目の式が返さ27れます. 私にとって最初の式が返されます53-言及していませんが、あなたが望む結果だと思います。

データに問題があります (数式ではありません)。最も可能性の高い原因は、C5 にはない C6 と C7 の末尾のスペースがあることです。C5 を C9 にコピーすると、これが修正されます。ただし、これら 2 つの行の他のセルにデータの問題がある可能性があります。

数式が別々の列にあると、作業が簡単になる場合があります。

于 2014-09-17T20:02:21.823 に答える