Tutorial by Examples

Source table RowABCD1CodeProductColourPrice21penred50032penblue-5043penred054pencilblue1765pencilgreen-1.5 to select all: = QUERY(A1:D5, "select *") or = QUERY(A1:D5, "select A, B, C, D") or convert data range into array and use this formula: = QUERY({A1:D5}, "sel...
ABCD1penred5002penblue-503penred04pencilblue175pencilgreen-1.5 To sort by column D with "order by": =QUERY("A1:D6","select * order by D desc",1)
ABCD1penred5002penblue-503penred04pencilblue175pencilgreen-1.5 To only return "pencil" data: =QUERY("A1:D6","select * where B='pencil' ",1) To only return rows that contain "pen" (all rows): =QUERY("A1:D6","select * where B contains 'pen' ...
=QUERY(QUERY(A1:D6,"select C,SUM(D) group by C",1),"select Col2>0",1)

Page 1 of 1