Search code examples
criterialibreoffice-calc

how to use sumif to match multiple criteria on same range


how to use sumif to sum up multiple criteria on same range?

i use the formula =sumif(C3:C7,{"A","B","C"},D3:D7), it was able to sum-up only "A". Even through =sum(sumif(C3:C7,{"A","B","C"},D3:D7)) does not work as well as shown in this screenshot screenshot


Solution

  • Try

    =SUMIF(C3:C7;"A";D3:D7)+SUMIF(C3:C7;"B";D3:D7) +SUMIF(C3:C7;"C";D3:D7)
    

    or

    =SUMPRODUCT(SUMIF(C3:C7;{"A";"B";"C"};D3:D7))
    

    or

    =SUMPRODUCT(D3:D7;(C3:C7="A")+(C3:C7="B")+(C3:C7="C"))