Natalia
Natalia

Reputation: 197

Excel: if year X, then sum values from multiple rows

I have a table with projects, each project has multiple work packages. I need to create a formula or pivot table with the following condition:

The result should be as seen in this screenshot:

enter image description here

Upvotes: 0

Views: 219

Answers (2)

Josh Friedlander
Josh Friedlander

Reputation: 11657

If you'd like to use a formula, use SUMIFS as Luuklag suggested. For your example, assuming the layout is like this

enter image description here

it would be this:

=SUM(SUMIFS(D2:D6,C2:C6,{2015,2016},A2:A6,A10))

The reason is that SUMIFS by default uses only AND logic, so you need to use an array, and then an outer sum (see here for more).

Upvotes: 3

ManishChristian
ManishChristian

Reputation: 3784

How about this using Pivot table...?

enter image description here

Select 2015 and 2016 from filter.

Upvotes: 1

Related Questions