Skip to content

Instantly share code, notes, and snippets.

@seanrankin
Created August 22, 2019 10:08
Show Gist options
  • Save seanrankin/4fa62b8a8eabcf2e1dd839087bbfa75c to your computer and use it in GitHub Desktop.
Save seanrankin/4fa62b8a8eabcf2e1dd839087bbfa75c to your computer and use it in GitHub Desktop.
Google Sheets Formulas
// Selections
=query(A1:A,"Select *")
// Array Formulas Iterate Through Rows
=ArrayFormula(
IF(ROW(B:B) = 1,"Column Header",
"Write something here..."
)
)
// ArrayFormula Auto Number
=ArrayFormula(if(B3:B<>"",row(A3:A)-2,""))
// ISBLANK checks for emptiness
isblank(A1)
// Ifs check multiple conditions
=IFS(A2 > 90, "A", A2 > 80, "B")
// And checks all conditions
AND(A2<50,A3<>75,A4>=100)
// Returns the row #
ROW(A4)
// If statement
IF( ISBLANK(A1), "Do this", "Else do this")
// Inderectly access the value of a cell
INDIRECT("C"&"10")
// Combine values to a string
CONCAT("A", ROW())
// Get a valuse by ref and offset
INDEX(A2, 0, 0)
=ArrayFormula(
IF(ROW(E:E) = 1,
"Description",
IF(ISBLANK(D:D) = false,
generateLineItemDescriptions(formatDateToString($C2), formatDateToString($D2), 1, {Rates!D2:D13}),
""
)
)
)
=ArrayFormula(B:B)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment