Home > Mobile >  Google Sheets Error: column doesn't load when querying multiple sheets
Google Sheets Error: column doesn't load when querying multiple sheets

Time:11-13

I'm trying to query two separate sheets to a cell in my budget. One of the sheets is a google form I use to track my daily cash transactions, and the other is a ledger I'm using to input my bank transactions.

If I query either one of the sheets like this, either works fine:

=SUM(QUERY('Form Responses'!$A$1:$C$400,"SELECT B,C WHERE B = 'Coffee'",1))/$D$1
=SUM(QUERY(Ledger!$A$1:$C$400,"SELECT B,C WHERE B = 'Coffee'",1))/$D$1

HOWEVER, when I try to combine them like this...

=SUM(QUERY({'Form Responses'!$A$1:$C$400;Ledger!$A$1:$C$400},"SELECT B,C WHERE B = 'Coffee'",1))/$D$1

I get this error:

Unable to parse query string for Function QUERY parameter 2: NO_COLUMN: B

I have gone deep into forums and SO, and have found lots of tips - but none of them work and many of them are depreciated. Can anyone solve this issue at a glance?

I don't understand how there can be a 'Column B' when they're queried individually, but not when queried together.

CodePudding user response:

use:

=SUM(QUERY({'Form Responses'!$A$1:$C$400; Ledger!$A$1:$C$400},
 "select Col2,Col3 where Col2 = 'Coffee'", 1))/$D$1
  • Related