I'm following the reference for GQL here: https://developers.google.com/chart/interactive/docs/querylanguage
What I was trying to do is select a name from col A, if a value is set in col C, based on the highest value in col H, limited to 1 result.
=QUERY(A5:H100,"select A where (H='"&MAX(H5:H100)&"' and C = 'X') limit 1")
However, all this is doing is returning the first 2 entries from Column A. =MAX(H5:H100) returns 10.
Even Stranger, if I remove the ' surrounding the &MAX(H5:H100)& section, then it still returns the first 2 entries from Column A into the field with the formula, but puts the correct, expected match (the value of A on the row with H=10) into the next row below it.
Am I missing some major piece of the QUERY function?