Michael Liew
Michael Liew

Reputation: 337

GoogleSheets Query formula skipping a cell

I've got a sheet where I'm using a Query formula to create a small "reporting section"

It's working fine except for the fact that it's missing data for the top right cell.

I've put a simplified screenshot below

enter image description here

So the query is basically getting data from the bigger table on the left where Column B matches the name in cell G2.

It's working fine, in that it is returning the data when I change the employee name, but for some reason, it skips the top right cell (highlighted in red)

It should say Figures there, but for some reason it's empty and I can't figure out why.

Even if I take out the where clause in my query formula. I get all the data, and the Figures value is in the top row, but further down it's missing, and I have no idea why.

enter image description here

Upvotes: 0

Views: 1285

Answers (1)

doubleunary
doubleunary

Reputation: 18809

The query() function only supports one data type per column. The subheadings are text, and will be returned as null because they are in a numeric column.

To make it work, put these values in cells B1:D1:

Employee Project Name Figures

The choose View > Freeze > 1 row and delete the rows in the data table where column C is Project Name, and modify the formula like this:

=query(B1:D, "where B = '" & G2 & "' ", 1)

Upvotes: 1

Related Questions