PIVOT - combine two columns in one field

AmNimru

New Member
Joined
Feb 26, 2013
Messages
29
Hello everyone,

Is there a way I could combine the data from two columns in one field in PIVOT table?
The data looks something like this:

Product AProduct BQuantity - product AQuantity - product B
ID14ID2104
ID1412
ID210
ID16ID14207
ID17ID161011

<tbody>
</tbody>


So, I would like to have in one PIVOT field combined products from both columns A and B (with removed duplicates) and the sum of quantities from both column C and D, depending in which column the product is placed.
It would be the same as using SUMIF from field C if product is in column A + SUMIF from field D if product is in column B.

Anyone has any idea how to do this?
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
You would have to rearrange your table so you have 1 column with the product name, 1 column with the ID and one column with the quantity. Something like:

*ABC
1ProductIDQuantity
2Product AID1410
3Product AID1412
4Product AID210
5Product AID1620
6Product AID1710
7Product BID24
8Product BID147
9Product BID1611

<colgroup><col style="font-weight:bold; width:30px; "><col style="width:67px;"><col style="width:34px;"><col style="width:61px;"></colgroup><tbody>
</tbody>

Excel tables to the web >> Excel Jeanie HTML 4

You can then insert a Pivot and put the Product and ID in the ROWS field and the Quantity in the Values field.
 
Upvote 0
Thanks for you reply!
I was afraid I might have to do that (and from 300.000 rows of data get 450.000), but I was really hoping I could avoid it.
 
Upvote 0

Forum statistics

Threads
1,216,101
Messages
6,128,835
Members
449,471
Latest member
lachbee

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