Ask Your Question

LO Spreadsheet: If cell-range contains X, then do Y [closed]

asked 2013-12-13 15:28:26 +0200

nighthome gravatar image

updated 2020-08-02 17:12:44 +0200

Alex Kemp gravatar image

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 flag offensive 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

1 Answer

Sort by » oldest newest most voted

answered 2013-12-13 16:51:06 +0200

Rugslug gravatar image


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.


edit flag offensive delete link more


Thanks, that works. Seems I can't mark your answer as "solved my issue" or it's in my blind spot.

nighthome gravatar imagenighthome ( 2013-12-15 17:40:52 +0200 )edit

Question Tools

1 follower


Asked: 2013-12-13 15:28:26 +0200

Seen: 5,853 times

Last updated: Dec 13 '13