Quantcast
Channel: Hot Weekly Questions - Web Applications Stack Exchange
Viewing all articles
Browse latest Browse all 9782

In Google Sheets, take the first and last value of a query to sumarice, grouped by user and shorted by date

$
0
0

I have a spreadsheet with a list of users, a value, and a date:

The Spreadsheet

And I would like to take the first and the last value of column B grouping by column A (the user) and shorted by column C (the date of the value) and substrac this values

John 42-106 (-64)

Arthur 47-113 (-66)

Ben 53-48 (5)

Daniel 125-125 (0)

Richard 46-121 (-75)

I'm new with the query and the most I found is a sum query, grouped correctly, but shorted by the value, not the date

=query(A:C,"Select A,B, sum(B) group by A,B")

wrong shorting

I tryed to add the order by column C argument

=query(A:C,"Select A,B, sum(B) group by A,B order by C")

but it didn't work. #VALUE!

and, of course, I don't want a sum, I need a substrac...

I can make a external cell with the substrac if the query only repond with the values in different columns (John | 42 | 106), but I need that the data became shorted by the date like (Ben | 53 | 48)...

What can I do?


Viewing all articles
Browse latest Browse all 9782

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>