Data Table to Pivot Table then Update Data from Pivot Table

jbesclapez

Active Member
Joined
Feb 6, 2010
Messages
275
Hello,

I would like to have a Data Table that creates a Pivot Table. Then I want to insert or change data in the pivot table that would "update" the Data Table back. It will be a 2 steps thing.

Here is the Table :

ColAColBColCColD
CH1.4PEQ001R19OK
LOUPEQ001R13ToDo
CH1.4DIARQ001R22OK
CH1.4DIARQ001R31OK
BIDLOCOQ001R21ToDo
BIDLOCOQ001R31bToDo
CH1.4LOCOQ005R03ToDo
GAPOEQ005R01INCOH
CH1.4OEQ005R04INCOH
CH1.4OEQ006R05OK
GAPOEQ006R01OK
BIDPEQ001R19OK
GAPPEQ001R13ToDo
CH1.4PEQ005R04OK
LOUPEQ001R31bToDo

<tbody>
</tbody>


And it creates a table like below (same then a pivot table)
Please note the cell A1. It has to be filtered on that which is the ColB of the table.


PE
Q001R19Q001R13Q001R22Q001R31Q001R21Q001R31bQ005R03Q005R01Q005R04Q006R05Q006R01
CH1.4OKOK
LOUToDoToDo
BIDOK
GAPToDo

<tbody>
</tbody>

I know it is tricky because a Pivot table cannot be done as it does not work with Data. (only count, sum...). The trick I used was to put a unique number in ColD and in the pivot table show the MAX number. Then I did a replace to change the number with actual Name in ColD. However, I have not idea how to go back from Pivot Table to Data Table...

I hope one of you will know how to do that better than me.

Thanks for your time
 
yes, that is the SQL
for use in this instance in a query table

exact set up might be version dependent

if the file is saved with defined name 'YourTable' for the source data table/range,
ALT-D-D-N to start the wizard, Excel files, OK, select the file, then the data table (YourTable), then any field and continue to the last step.
At this point select the option to edit in MS Query, then via the 'SQL' button see the current SQL, fully replace it by the above SQL, then OK.
OK to the message about not being able to graphically represent.
see the result set,
via the 'open door' icon exit MS Query & create the query table in a worksheet

it is refreshable like a pivot table.

cheers
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
there are old threads where query table results took less than a second and (large numbers of) array formulas took hours to get the same answer

a little SQL can do a lot of work
 
Upvote 0
there are various ways, and how to see the SQL will be version dependent

in older Excel versions you could go through the wizard again. or in the VBE's immediate window debug.print the SQL

i'm not so familiar with newer versions & even though I use a recent version still use the old keyboard shortcuts, not the ribbon. try looking for data properties, or check in Excel help. (VBA would also be an option, btw, but is not necessary)
 
Last edited:
Upvote 0
there are various ways, and how to see the SQL will be version dependent

in older Excel versions you could go through the wizard again. or in the VBE's immediate window debug.print the SQL

i'm not so familiar with newer versions & even though I use a recent version still use the old keyboard shortcuts, not the ribbon. try looking for data properties, or check in Excel help. (VBA would also be an option, btw, but is not necessary)


Hi Fazza, and thanks for your info.
However, I am not familiar with that way of doing SQL in the excel.
Do you mind creating a small exemple that we could download and look? I am really curious on how to do that...
 
Upvote 0

Forum statistics

Threads
1,216,064
Messages
6,128,562
Members
449,458
Latest member
gillmit

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