Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using SUMIF correctly on google spreadsheet

I want a cell to give me the sums of the cells above, only when another column has values in it as well. For instance, I want B5 to sum up B1:B4, only when C1:C4 also have values, if a C cell doesn't have a value, then I want the corresponding B cell to be counted as a 0 during the sum. I looking up info on SumIf and FILTER but I don't know what to put in the criteria to make it accept any number, and how to report 0 when no number is available. Any help would be appreciated.


What I tried doing so far: =FILTER(B1:B4;C1:C4=value() and I get an error

like image 689
user28790 Avatar asked Sep 28 '13 11:09

user28790


People also ask

Why is my Sumif formula not calculating correctly?

SUMIF Not Working Because of Uneven Data Format At first, you have to check the sum range whether it is in the proper number format or not. While importing data from other sources, facing uneven data formats is not so rare.

What is the correct way to apply Sumif formula?

If you want, you can apply the criteria to one range and sum the corresponding values in a different range. For example, the formula =SUMIF(B2:B5, "John", C2:C5) sums only the values in the range C2:C5, where the corresponding cells in the range B2:B5 equal "John."

How do you do a Sumif with two criteria in Google Sheets?

If you want to learn how to use SUMIFS function in Google Sheets, you need to define both sum range from which are values summed and criteria ranges with criterions using the formula: =SUMIFS(sum_range, criteria_range1, criterion1, [criteria_range2, ...], [criterion2, ...]) .


2 Answers

Have you tried using SUMIF like this:

=SUMIF(C1:C4, "<>", B1:B4)

?

It's working for me.

like image 127
Jerry Avatar answered Sep 22 '22 03:09

Jerry


Try:

=SUMIF(C1:C4; "<>"; B1:B4)

or also, as Jerry suggested:

=SUMIF(C1:C4, "<>", B1:B4)

Note that the semi-colon separator is supported in all locales, so it is generally preferred.

like image 42
nibbana Avatar answered Sep 22 '22 03:09

nibbana