SumProduct within Pivot Table

leatherhen99

New Member
Joined
Dec 17, 2019
Messages
27
Office Version
  1. 365
Platform
  1. Windows
Good Afternoon,

I have finally been able to apply simple logic to my formulas, but now, I need one column in my pivot table (dates across the top... and I need one field per day)... and I'd rather minimize the amount of VBA code that I have to write...as well, I don't want to make the logic too difficult if something changes and I have to fix something along the way. I won't be the end-user, so I want to make the spreadsheet as easy as possible...

So, is there a way to add a sumproduct calculation into a pivot table? I created a 'match' column... and I have it mapped to 6 fields..., and it works outside of the pivot table... but I can't seem to figure out how to write it inside a pivot table... I've attached a snippit to show the differences between what it's giving me within the pivot table and within the table with the sumproduct calculation.

Sumproduct formula:
=IF(V4="A",SUMPRODUCT(--(Table25[Match]=$S4&$T4&$U4&$W4&$X4&Y$3),Table25[Shift Diff]),SUMPRODUCT(--(Table25[Match]=$S4&$T4&$U4&$W4&$X4&Y$3),Table25[Reg]))
Match column:
=[@[Employee:]]&[@ET]&[@ER]&[@W]&[@Storm]&[@Date]

Logic is:
A="" or "A" in this scenario
If "A" = "A" (it's either "" or "A")
sumproduct (Match the "match" column to the following fields [@[Employee:]]&[@ET]&[@ER]&[@W]&[@Storm]&[@Date] * Shift differential)
Otherwise
sumproduct (Match the "match" column to the following fields [@[Employee:]]&[@ET]&[@ER]&[@W]&[@Storm]&[@Date] * Reg)

I've tried to use the sumif calculated field, but there are times when the "a" field is populated and both shift differential and regular time are both applicable... Any help would be SO appreciated!!!

Thanks!!!
Heather
 

Attachments

  • MrExcelExample.png
    MrExcelExample.png
    20.8 KB · Views: 12

Excel Facts

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

Forum statistics

Threads
1,223,627
Messages
6,173,417
Members
452,514
Latest member
cjkelly15

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