Google-sheets – Query + importrange not providing the answer i need

google sheetsgoogle-sheets-queryimportrange

I am attempting to get some information from a Google sheet

Basically if my website Id was to be lets say 14, I'd want to get the name in the row next to it;

I am using the function below;

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1er6drwogbR3-MAAYrtz96V1i_Cs0jTngcGYUeZ10rmA/edit#gid=1418684261", "A:Z"), "SELECT Col4 where Col5='14'")

My expected output would be 'Chad G' But I am getting 'Name' instead…

Best Answer

The problem is that Col5 has numbers but you are comparing it to a text value. Instead of Col5='14' use Col5=14

=QUERY(IMPORTRANGE("https://docs.google.com/spreadsheets/d/1er6drwogbR3-MAAYrtz96V1i_Cs0jTngcGYUeZ10rmA/edit#gid=1418684261", "A:Z"), "SELECT Col4 where Col5=14")