D
D
daddy4gym2020-01-12 12:40:43
Google Sheets
daddy4gym, 2020-01-12 12:40:43

How to add a value to a specific column when using the QUERY function?

How to add a value to the displayed column?

=QUERY(ТЕСТ!A7:P;"Select C,A,B,F Where A like '%' or  C like '%'")

For example, to display the value of the column F + "pcs"
Using formats is not suitable for my task

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-01-12
@oshliaer

The first thing that comes to mind is concatenation. But QUERYhe doesn't support her. Therefore, it is necessary to build an array of ready-made values ​​and work with it. For example, add "pcs." to the current array

=QUERY(
  {'ТЕСТ'!A7:P\ARRAYFORMULA('ТЕСТ'!F7:F & " шт.")};
  "Select Col3,Col1,Col2,Col17 Where Col1 like '%' or Col3 like '%'";
)

Another, more obvious way is the directiveformat
=QUERY('ТЕСТ'!A7:P;"Select C,A,B,F Where A like '%' or C like '%' format F'#.00 шт.'")

Well, the third way is to format the cells of column F on the "TEST" sheet. You can read here Formatting numbers in tables . Very similar to format from the previous version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question