Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to use information from a table to display a count of blank cells based on the type of data in the table. See my example below - I want to count how many of each fruit I'm missing, regardless of their color, and ignoring the apples I do have.


End result:

share|improve this question
up vote 2 down vote accepted

The following formula will almost retrieve the table you want.


 QUERY(data, query, headers)

   DATA!A1:C7,                                         // data
      LABEL COUNT(B) 'Amount of Empty Types'"             


Column A is selected to be shown. It is not possible, with the QUERY formula, to perform on the same column a count and select operation. Therefore I performed the count on column B. The where clause on column C is set to contain nothing. All results are to be grouped by column A. At the end of the query, the header/label is changed (otherwise it would show "count Color".


enter image description here


I've created an example file for you: Counting blank cells based on information in related cell

share|improve this answer
I was so close... That really cleared it up for me thanks so much. – Tom Dec 4 '13 at 15:31
I am getting a strange issue though. The Query works for every sheet except the First sheet. The query of my first sheet is returning all the data except the first 5 lines, and in the cell with the Query formula, it returns the first 4 lines from the Type column on the first sheet. – Tom Dec 4 '13 at 15:45
@Tom Why don't you add me to your file, so that I can have a look.... – Jacob Jan Tuinstra Dec 4 '13 at 21:21

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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