SELECT WHERE

Hi folks!

I have a sheet with columns A, B and C and liked to have in E1 the value of the cell in C where the cells in A and B have some specific values. In SQL I’d do:

select C from Sheet1 where A=‘foo’ and B=‘bar’

How can this be done in Calc?

Why not?

=SUMIFS(C:C;A:A;"foo";B:B;"bar")

or

=SUMPRODUCT(C:C;A:A="foo";B:B="bar")

It’s more like “select SUM(C)…”. But you said in the question that for the result you select one cell E1.

Ah, sure! SUMPRODUCT again! Thank you so much, hope I don’t need to ask this question a 3rd time! :slight_smile: