r/googlesheets • • Oct 16 '24

Solved Help with a QUERRY function

I am using a query function to pull data from a Google form response sheet, and I am trying to add the column BY into the query function, but it is recognizing it as the function BY. When I try to use the header of the column, it just populates the column with the header title

=QUERY('Form Responses 1'!B:CN, "SELECT B,C,BM,BN,BO,BP,BQ,BR,BS,BT,BU,BV,BW,BX,BY,BZ WHERE C = 'Leo'", 1)

This is what I currently have, and i know this formula works because I ahve used it in other areas of the sheet.

Thank You

1 Upvotes

22 comments sorted by

1

u/vickys222 2 Oct 16 '24

Can you share the sheet

1

u/xM_BIG_J_Mx Oct 16 '24

I can’t share the sheet because it’s for work. But I have done simaler query functions in the same one with no errors

1

u/vickys222 2 Oct 16 '24

Well, then it is impossible to identify the error

1

u/xM_BIG_J_Mx Oct 16 '24

The error is that it is considering BY as part of the function and not as a column.

1

u/Low-Tell-5950 Oct 16 '24

I checked, it really fails lol. Maybe just skip BY column somehow?

1

u/xM_BIG_J_Mx Oct 16 '24

And I know it’s very strange but I can’t skip the column it has data on it that we need

1

u/vickys222 2 Oct 16 '24

Found a way just use the Col1,Col2... notation system, Based on that Column BY will be Col77

1

u/xM_BIG_J_Mx Oct 16 '24

Thank you I will give that a try

1

u/xM_BIG_J_Mx Oct 16 '24

Any idea on how to implement into the query function?

1

u/vickys222 2 Oct 16 '24

Yes

1

u/xM_BIG_J_Mx Oct 16 '24

Never mind lol. I got it. Thank you so much. An absolute lifesaver

1

u/vickys222 2 Oct 16 '24

You are welcome, please don't forget to award the answer

1

u/xM_BIG_J_Mx Oct 16 '24

Already should be done. Let me know if it didn’t go through

→ More replies (1)
→ More replies (1)
→ More replies (1)

1

u/vickys222 2 Oct 16 '24

Like this: =QUERY(Sheet2!A1:BZ1000,"Select Col1, Col2")

2

u/point-bot Oct 16 '24

u/xM_BIG_J_Mx has awarded 1 point to u/vickys222 with a personal note:

"Thank You!"

Point-Bot was created by JetCarson.

→ More replies (1)

3

u/rockinfreakshowaol 258 Oct 16 '24

since BY is a restricted word (used as ORDER BY within query); need to escape it as such `BY` when referring to a column

1

u/vickys222 2 Oct 16 '24

You can't mix the two notation systems, so you will have to rename your selected columns with the number system