If a Google Sheets QUERY drops a row whose value looks like a number, see whether Sheets stored that cell as text. The query treats each column as one type. Values stored as a minority type are treated as null, so a filter such as where B > 0 can silently omit a row.

Reproduce the missing row

  1. In an empty sheet, put Name and Hours in A1 and B1. In A2:A4 enter Ada, Ben and Cara. Enter 4 and 2 in B2 and B3. Enter '3 in B4, with the leading apostrophe, to store Cara’s hours as text.
  2. Enter =ISNUMBER(B4) in a free cell. It should return FALSE, even though the cell displays 3.
  3. In E1, enter the query below. The final 1 means that the input has one header row. Expect Ada and Ben only, with a total of six hours.
=QUERY(A1:B4,"select A,B where B > 0",1)

Convert and check the values before filtering

Add a Hours (number) header in C1. Put the first formula below in C2 and copy it down through C4. This leaves blank inputs blank and puts a visible CHECK next to any value Sheets cannot convert. Use the second formula to count flagged rows. Review those inputs before relying on the query.

=IF(B2="","",IFERROR(VALUE(B2),"CHECK"))
=COUNTIF(C2:C4,"CHECK")

Once the flag count reaches zero, run the query against column C. Check that all three names appear and that the normalized hours add up to nine. Keep column B untouched while checking the conversion so discrepancies are easy to trace.

=QUERY(A1:C4,"select A,C where C > 0",1)
=SUM(C2:C4)

Look for values that parse but still mean something else

VALUE can interpret dates and times as numbers. If your hours column contains pasted dates, a successful conversion can still return a number that makes no sense for a shift. Spot-check unfamiliar formats and flag any result outside the range a shift can reasonably have. For sheets that receive decimal commas or copied times, use a sample from the real import to verify how the spreadsheet’s locale interprets it.

Sources