Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display zero in place of error in filter formula in google spreadsheet

I am new to Google spreadsheet functions and trying to apply a formula in following way:

I have sheet1 & sheet2 in one workbook (name-formula4). I am doing sumproduct of filtered range from sheet1 to sheet2 with the following formula:

=SUMPRODUCT(filter(Sheet1!$A$1:$A$401, (Sheet1!$B$1:$B$401>= E1) * (Sheet1!$B$1:$B$401<= E2)))

Formula is perfectly ok when the range selected
(Sheet1!$B$1:$B$401>= E1) * (Sheet1!$B$1:$B$401<= E2)
has some value & is not empty. However if I leave the cells of said range empty (sheet1!b1:b3) -which are required to meet criteria- then this gives the error No Matches are found in filter evaluation. In a nut shell, I want to display 0 rather than displaying the error or NA.

Note that I cannot fill entire the selected B column since this receives live data from the form and not previous decided which one.

Please look at the following link for details and help in correcting the above formula:

https://docs.google.com/spreadsheets/d/1HTXf4VG2JupiP9UqCLRyAddYjhsom1leQOI9-DwfMaY/edit#gid=0

like image 596
user3811050 Avatar asked Mar 25 '15 11:03

user3811050


People also ask

How do I change the error 0 in Google Sheets?

We can replace #DIV/0 with 'N/A' (or anything else of our choosing) by updating the formula to =IFERROR((C5/B5 - 1),“N/A”) . IFERROR checks the value for (C5/B5) -1 , sees that the result is an error because you're trying to divide by zero, and so returns the text “N/A” .


1 Answers

=IFERROR(SUMPRODUCT(filter(Sheet1!$A$1:$A$401, (Sheet1!$B$1:$B$401>= E1) * (Sheet1!$B$1:$B$401<= E2))),0)
like image 198
Vasim Avatar answered Nov 09 '22 00:11

Vasim