2

Using LibreOffice Calc with the expression SUMIF, is there a way to make the criteria field look for 2 types of values using OR logic? Or do I have to make 2 separate SUMIF's and just add them up?

A    B  
Joe  1  
Joe  2  
Tim  3  
Roy  4  
Tim  5  
Roy  6  

How do I make a SUMIF to the rows for Joe and Roy so the result is 13? Basically I want it to sum IF cells in A are Joe OR Roy.

Thanks

tohuwawohu
  • 11,143

1 Answers1

2

You may use the pipe character | for alternative matches:

=SUMIF(A1:A6;"=Joe|Roy";B1:B6)

Take care to adapt the semicola ; depending on your localisation, and make sure that regular expressions are enabled in the settings (Tools -> Options -> LibreOffice Calc -> Calculate).

tohuwawohu
  • 11,143