A
A
Adven01042019-02-06 10:00:56
Google Sheets
Adven0104, 2019-02-06 10:00:56

How to round off in a QUERY?

Good afternoon!
I work with Google Spreadsheet. The example is for educational purposes only.
I am doing a QUERY query in which I get a numeric value, after which I want to display an additional column with a rounded value.
=QUERY(A:C;"select A, '"& ОКРУГЛ(&"'A'"&;1)&"'")
The desired result could not be achieved, the error "Syntax error" falls. I would be glad to help :)
Thanks for reading the question!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2019-02-06
@Adven0104

Google Query Language does not support the rounding directive.
5c5a958660d93221607154.png
You can use rounding formatting which solves the display issue

=QUERY({A2:A6,A2:C6},"select Col1, Col2 format Col1'', Col2'#.00'")

or preliminary rounding, which may introduce some inaccuracies in the resulting data
=QUERY({A2:A6,ARRAYFORMULA(ROUND(A2:A6,2))},"select Col1, Col2")

Spreadsheet example https://docs.google.com/spreadsheets/d/1NfP4x3S_EU...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question