0

I've a QUERY() function that results into this automatically generated table:

A B
S 2
F 5
G 1

I'd like to add a constant value to each cell in column B like (let's say 3):

A B
S 5
F 8
G 4
1
0

In your query() formula, insert + 3 after the reference to column B.

See the query language help page.

0

We'll assume that your existing query is:

  • =query(A1:B4,"select A, B")

Replace this with:

  • =query(A2:B4, "select A, B+3 label B+3 'B',A 'A'")

Two things to note:

  • Range - the header row is removed from the data range.
  • Labels - the column labels are assigned manually.

FWIW, even if you included row#1 in the Data Range AND used a value of "0" for headers, a new header 'sum(3())' would appear above column B. So it is easier to exclude the header row altogether, and to manually assign labels for both Columns.


Sample

screenshot

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.