leatherhen99
New Member
- Joined
- Dec 17, 2019
- Messages
- 27
- Office Version
- 365
- Platform
- 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
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