Skip to content

robiningelbrecht/google-spreadsheets-improved-query

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Google spreadsheets improved query

Use column names in your Google Spreadsheets QUERY() functions. This script is based on this YouTube tutorial.

Script ID: 1BZyZAV5h_cgqvMh0oU86PiKC_GK6yMPPk74eDmQjZ2Ijrhm-si3BwUxd

Usage

=QUERY(A1:H, SELECT("SELECT SUM([amount]) WHERE [amount] > 0 LABEL SUM([amount]) ''", 'A1:Z1), 0) 

SELECT expects 2 parameters:

  • Your query
  • Range of the column names (should be exactly one row)

Query placeholders

Each column name (= placeholder) needs to be surrounded with [ ] and can be targeted with the camelCase version of the names in the "header row":

Column name camelCase field
id [id]
Purchased On [purchasedOn]
Amount [amount]

Adding the library to your project

The 'SELECT` function is made available as a script library. Follow these steps to add it to your project.

About

Use column names in Google Spreadsheets QUERY()

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors