Sum for 2 criteria from Pivot table

Joined
Feb 16, 2016
Messages
21
Hey evryone,

I have question regarding following issue. My pivot table looks like this:

[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Month[/TD]
[TD]Asset[/TD]
[TD]Order[/TD]
[TD]Sub parcel for order[/TD]
[TD]Occupation of asset[/TD]
[TD]Occupation for one order[/TD]
[TD]Month sum[/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]S2[/TD]
[TD]A[/TD]
[TD]prod A[/TD]
[TD]21:30h[/TD]
[TD]21:30h[/TD]
[TD]???[/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]S2[/TD]
[TD]A[/TD]
[TD]prod B[/TD]
[TD]21:30h[/TD]
[TD]0[/TD]
[TD]???[/TD]
[/TR]
[TR]
[TD]Jan[/TD]
[TD]S2[/TD]
[TD]B[/TD]
[TD]prod A[/TD]
[TD]10:03h[/TD]
[TD]10:03h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]S1[/TD]
[TD]C[/TD]
[TD]Prod C[/TD]
[TD]17:14h[/TD]
[TD]17:14h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]S2[/TD]
[TD]D[/TD]
[TD]Prod Z[/TD]
[TD]46:10h[/TD]
[TD]46:10h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]S2[/TD]
[TD]D[/TD]
[TD]Prod Y[/TD]
[TD]46:10h[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]S2[/TD]
[TD]D[/TD]
[TD]Prod A[/TD]
[TD]46:10h[/TD]
[TD]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Feb[/TD]
[TD]S1[/TD]
[TD]E[/TD]
[TD]Prod B[/TD]
[TD]16:50h[/TD]
[TD]16:50h[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]....[/TD]
[TD]....[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]


What I need to do is: for each month per asset determine the asset occupation for all orders.
I have already split the time for one order as they are repeated in the order occupation.

So i need to add all Jan times for asset S2 from the column 'Occupation for one order', all Jan times for asset S1 from the column 'Occupation for one order', all feb times for asset S1 from the column 'Occupation for one order', all feb times for asset S2 from the column 'Occupation for one order', ..... . And these values need to populate the last column.

I manage to work out a formula for one month and one asset with sumifs but would have to repeat each piece of code for each month and asset. I was thinking there must be an easier way with array formulas but am not that experienced with them.
Any help would be much appreciated. =)

Kind regards,
Philippe de Vlaminck
 
Last edited:

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
I have found a solution that works:

1. Created a pivot table from the current table
2. Extra column after original table with index match array formula: =INDEX('Pivot jetty occ'!$A$3:$F$15,MATCH(TRUE,('Pivot jetty occ'!$A$3:$A$15='Jetty occupation sheet'!$B6),0),MATCH(TRUE,('Pivot jetty occ'!$A$3:$F$3='Jetty occupation sheet'!$C6),0))
3. CTRL-SHIFT-ENTER and copy down

If there is a solution without making an extra pivot table it would still be welcome :)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,880
Messages
6,175,157
Members
452,615
Latest member
bogeys2birdies

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top