LO Spreadsheet: If cell-range contains X, then do Y [closed] I'm unsure how to do this.

Task: If e.g. cell B12 to B41 contains value "1", then and only then, create SUM of cells C12 to C41 with the value they have (but only for the rows in which the B-column does have a value "1") and enter that value into target cell C 60.

Maybe I better describe what I'm trying to do here: I keep track of something in a table that has colums Mo-So for the weekdays in which I enter a 1 if the event is on that day. Next to that I have columns going from 9-24 which is the hour of the day. If a certain even happens I enter a "1" for that hour of the day.

What I now want is some formula that does the following: Create a nice weekly table for all weekdays and add events at the correct hour they happened.

I'm unsure how to do this. Guess it's possible but the formula needed makes me dizzy and I don't know where to start.

edit retag reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp close date 2015-11-16 16:51:04.291217

Sort by » oldest newest most voted Hi,

Try using either SUMIF or SUMIFS. SUMIFS allows for multiple criteria.

In cell C60, =SUMIF(B12:B41,"=1",C12:C41)

This formula will look at B12 to B41, checks to see if there is a 1 (use the quotes even for numerical values), then adds up the corresponding value in the range C12 to C41.

Tim

more