Justin Benfit
Justin Benfit

Reputation: 483

Query Function not working in Google Sheets

I am having a lot of trouble with this. I found the problem but don't know how to solve it. This is my query function in Google Sheets. The error it is giving me is: "Unable to parse query string for Function QUERY parameter 2: AVG_SUM_ONLY_NUMERIC"

I realized that this is happening because the values in Column Q are actually another function.

For example, Visibly one cell in column Q is "$1,338.1424" but if you click on the cell the actual contents are "=IF(ISBLANK(R12)," ",R12*L12)" I can't figure out a way to make the query function sum the values in Column Q in light of this issue. Any help would be greatly appreciated as I have not been able to find anything to help.

=query(Trades_April,"SELECT SUM(Q) WHERE W Contains 'PS'")

Upvotes: 0

Views: 2934

Answers (1)

Daniel H.
Daniel H.

Reputation: 680

The problem is not that the cell has a formula in it but that the value "$1,338.1424" is not numeric, it is text.

Solution: Try to change the formula in the cell to this:

=IF(ISBLANK(R12)," ",VALUE(R12*L12)

Another possibility may be: selecting the column Q and changing the format to "Number".

If these did not work, please post a link to a version of your spreadsheet (without sensitive data) and I will try to make it work.

Upvotes: 1

Related Questions