Home > Enterprise >  Query to pull data based on combined same name, sum quantity based on item condition
Query to pull data based on combined same name, sum quantity based on item condition

Time:10-27

I'm trying to build a simple inventory management system on a google sheet. Right now I'm stuck on something that I couldn't figure out how to solve. So I'm seeking help to solve this issue.

In my Purchase DB sheet I have row data column A is the Item name, column B is the Item quantity, column C is for a unit of measure & column D is for item condition:

enter image description here

I want a query or formula that pulls this row data and then combined similar item name sum quantity & which must be separated by the item conditions. I mean the same item name:

enter image description here

Please use this google sheet** enter image description here

CodePudding user response:

=QUERY(A1:D, "select A, sum(B),C,D group by A,C,D Order by A desc LABEL sum(B) 'Quantity'",1)

This should do the work.

Tested in you sheet with you values and return correct result

  • Related