I have a Google Sheets like this:

Hours | Project
2.5     ABC
0.5     DEF
1.0     ABC
0.25    GHI
1.5     DEF

I would like to create an output that shows me all combined hour values on a per-project basis, so something like:

Hours combined | Project
3.5              ABC
2.0              DEF
0.25             GHI

This seems a rather simple logic, but I don't even know what exactly to search for.


The easiest way to achieve that will be with QUERY(). Assuming your data is in A6:B11, to obtain the result you want use the following formula:

=query(A6:B11, "select B, sum(A) group by B", 1)

enter image description here

| improve this answer | |
  • Great, thank you a lot! I added in an additional is not null check to not sum hours that don't have a project, other than that it works perfect. Leaving the -1 for headers away makes more sense on my data. – kontur Jun 12 '17 at 16:57

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.