0

I'm doing a simple query but keep getting the error "Add_col_to_group_by_or_agg:Col1".

The formula is

=QUERY({L42:N63}, "Select (Col1*Col3)/Sum(Col1)",0)

What I'm looking for is just as straightforward as the column of result, multiply, then divide by the sum. Thank you in advance.

1

1 Answer 1

0

This is perhaps easier to do without query(), like this:

=arrayformula(L42:L63 * N42:N63 / sum(L42:L63))

2
  • thanks for that @doubleunary, I actually forgot to mentioned that, the range "L42:N63" is going to be replaced by the result from another query. Something like =QUERY(QUERY({Range}), "Select (Col1*Col3)/Sum(Col1)",0). I was just putting the range in actual cell to test which part I'm getting wrong. So by that I think I've to do it using query. I think the problem came from the "/SUM(Col1)" part, after some testing. But I just not knowledgeable enough to understand what is going wrong here. Thanks
    – NG_
    Oct 6, 2021 at 10:32
  • The policy here is just one question per post, so please post your new question in another topic. Oct 6, 2021 at 12:17

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .