ADVERTISEMENT
Google AdSense Slot (headerLeaderboard)

Set your Publisher ID in src/config/ads.ts to display live ads.

Google Sheets & Cloud Spreadsheets Mastery• 7 min read

The Super-Powered QUERY() SQL Function

Use the Google Visualization API Query Language to perform SQL-like SELECT, WHERE, GROUP BY, and ORDER BY inside spreadsheets.

Using SQL inside Google Sheets

The =QUERY() function allows you to execute complete SQL statements directly on cell ranges.

Aggregating Department Totals with QUERY
=QUERY(A1:E1000, "SELECT B, SUM(D) WHERE E = 'Active' GROUP BY B ORDER BY SUM(D) DESC LIMIT 5", 1)
ADVERTISEMENT
Google AdSense Slot (inContentBanner)

Set your Publisher ID in src/config/ads.ts to display live ads.

Test Yourself With Exercise

+15 XP

Which unique Google Sheets function accepts SQL statements like SELECT, WHERE, and GROUP BY on tabular ranges?