0

I'm in the midst of creating some code to query my data. Here's an example of said data: enter image description here


Text version of image

Name ToF AOF
Jon Cena Buyer 1
Tim Brown Seller 3
Cabel Guy Buyer 5
Cabel Guy Seller 1
Cabel Guy Seller 1
Tim Brown Buyer 1
Cabel Guy Buyer 7
Tim Brown Seller 1
Cabel Guy Seller 32
Tim Brown Trade 1
Cabel Guy Seller 1
Tim Brown Seller 1
Cabel Guy Seller 1
Tim Brown Seller 1

currently I'm trying to group by more than 1 title, like this:

enter image description here


Text version of image

Name Buyer Seller Trade
John Cena 1 0 0
Tim Brown 1 10 1
Cabel Guy 3 35 0

However no matter what I do, I can only query for either Buyer, Seller, or Trade and not all three, I don't know what the solution here would be at all! Here's what I have for my code

=query({listAll!A1:listAll!C1000}, " select Col1,sum(Col3) where Col1 <> '' and Col2 = 'Buyer' group by Col1 label sum(Col3) 'Buyer' ",1)

I attempted every way possible I could think of like multiple group by lines, or multiple sum lines, however neither seems to work :( someone save me!

P.S Can't link to sheet because there's sensitive info on there I can't share!

1
  • While you may feel you can't share a link to the original spreadsheet, you can share a link to a separate spreadsheet which you set up with dummy data just like you show in your post, and where you then show where you want the solution, what you want the results to be (manually entered) and how you came to that. (For instance, you mention "Trade" with values of 0,1,0; but I don't see anything correlating with those numbers in your post. Sharing such a link is your best bet for receiving help. – Erik Tyler Feb 26 at 3:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.