Ask Your Question
0

SELECT WHERE

asked 2017-09-12 15:55:33 +0100

Deever gravatar image

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?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-09-12 17:49:33 +0100

JohnSUN gravatar image

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.

edit flag offensive delete link more
0

answered 2017-09-12 22:00:38 +0100

Deever gravatar image

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

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-09-12 15:55:33 +0100

Seen: 30 times

Last updated: Sep 12