Matching Difference section based on variable headers from two Pivot tables.

Aaron DOJ

New Member
Joined
Aug 10, 2018
Messages
36
Office Version
  1. 365
Platform
  1. Windows
I am not sure if it is even possible, but that I why I am reaching out to the masters of this forum.

Here is an example of the data:
ABCDGHIJLMNO
2​
Pivot Table 1Pivot Table 2Difference
3​
Brand NameC SOLDL SOLDS SOLDBrand NameC SOLDS SOLDC SOLDR SOLDL SOLDS SOLD
4​
A200.00A200.00-
5​
BB
6​
C500.00C500.00
7​
D7,600.00D8,000.00(400.00)
I am trying to get the cells below the "Difference" section (which is just normal cells, no table or pivot table) to correspond to the headers from Pivot Table 1 (PT1) & Pivot Table 1 (PT2). Then subtract PT2 from PT1 figures for example matching A, C SOLD or D, S SOLD needs to match "Brand Name" only like A to A, B to B, etc. (99% of the time these will be on the same row, but there is a chance they are off a line). Round to 2nd digit beyond the period, otherwise be blank if no data from either table. However, the variable headers PT1 & PT2 is the issue I can't really seem to resolve. Sometimes for example there will be L SOLD in one Pivot, but not the other, as pointed out above.

Below is the code I have, this was allowing me to do just about everything, but only worked if I had all four SOLD columns in both tables.
=IFNA(ROUND(IF($G5="","",H5-INDEX(B5,MATCH($G5,$A5,0))),2),"")
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,021
Latest member
Mohamed Magdi Tawfiq Emam

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