Search code examples
excellibreofficelibreoffice-calc

Conditional SUM with Calc based on a different column


I have a LibreOffice Calc sheet to quote my customers, I have it set with lookup functions so that when I type the ID of an article it pulls the description and price.

On the bottom there is the total and the possibility to add a discount, however I need to apply the discount excluding given articles.

Is it possible to sum a column considering the corresponding values of another row? Here is a simplified example:

Item   | Price
-------|---------
101    | € 115,00
102    | €  65,00
306    | € 320,00

The sum makes € 500,00 I need to have a separate cell where "sum price cell if column Item < 200" is that possible?


Solution

  • It's called SUMIFS, and even has its own tag.

    =SUMIFS(B2:B4;A2:A4;"<200")
    

    A similar question is at https://superuser.com/questions/556829/libreoffice-excel-sum-an-adjacent-cell-if-the-value-in-the-conditional-cell-is.