12

I am trying to get a sum of column values in a Google Spreadsheet only if there is no value in the adjacent column. Consider the following example:

  A | B
 -------
 40 | 50
 20 | 20
 30 | 
 10 | 

The sum of A should return 40.

I tried to use the following function:

=SUM(FILTER(A:A, ISEMPTY(B:B)))

but all I get is: Error: Unknown function name ISEMPTY. Can anyone tell me what's wrong or how to do it properly?

1
  • can you show with an example (input and output)? Feb 9, 2012 at 17:30

2 Answers 2

17

Replace ISEMPTY with ISBLANK

Your formula should be as follows:-

=SUM(FILTER(A:A, ISBLANK(B:B)))

Now you will get the result as 40

1
  • Although this is not a solution involving sumif; but it doesn't look like there is a way of doing with sumif!
    – Oliver
    May 28, 2018 at 18:36
1

If there is a value of 0 in the cell, it won't be flagged as blank. But you can use:

=SUMIF(B:B,0,A:A)

Or more restricted:

=SUMIF(B2:B50,0,A2:A50)

template: SUMIF(range, criteria, sum_range)

Adds the cells specified by a given criteria. Range is the range to which the criteria are to be applied. Criteria is the cell in which the search criterion is shown, or the search criterion itself. In the criteria section, you can use a question mark (?) to match a single character or an asterisk (*) to match a sequence of characters. If you'd like to find an actual question mark or asterisk, you can type a tilde (~) before the question mark (?) or asterisk (*). Sum_range is the range from which values are summed, if it has not been indicated, the values found in the Range are summed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.