+ Reply to Thread
Results 1 to 7 of 7

How to auto update a table when a change is happening to its source database

  1. #1
    Registered User
    Join Date
    11-18-2019
    Location
    Athens
    MS-Off Ver
    2016 - 2010
    Posts
    9

    How to auto update a table when a change is happening to its source database

    Hello Forum,

    I have a simple question, with a not-so-simple answer as it seems. So i have a workbook with 2 sheets. The first one contains the database regarding personnel's travel expenses each month (Pic 1)Screenshot_1.png.

    At the 2nd sheet i want to create a table that pulls data from the 1st one for for a later analysis based on three month periods (Q1, Q2, Q3) (Pic 2)Screenshot_2.png.

    However the personnel that will be included in the database (1st sheet) will be changing constantly due to the fact that during a calendar year a couple of people will be recruited, while a few others will leave the company. Thus, i want the table at the 2nd sheet to be dynamic and auto-update when i am changing the values, or when rows are being deleted or inserted in the first sheet where the database is. For example, if i insert another employee in my database, i do not want to update my table at the 2nd sheet manually by inserting a row and the existing formulas copying formulas.

    I tried this by creating a pivot table in conjunction with the offset formula, but the result was kind of clunky. I really do not know if what i want to do is plausible and whether it requires the use of pivot, formulas, vba or a combination of them.

    Thanks in advance!
    Attached Files Attached Files
    Last edited by Excelol; 12-03-2019 at 05:33 PM. Reason: typos

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: How to auto update a table when a change is happening to its source database

    It might be simpler if the data was arranged differently.
    In the attached the months in row 1 have been converted to dates and the range converted to a table.
    Using Get & Transform the data below the dates is unpivoted and loaded as a table on Sheet3 using:
    Please Login or Register  to view this content.
    A column that calculates the quarter (Q) was added to the table and populated using: =ROUNDUP(MONTH([@Month])/3,0)
    Table1_2 serves as the source data for the pivot table (also on Sheet3).
    As Table1_2 is updated the pivot table will update (when refreshed).
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,293

    Re: How to auto update a table when a change is happening to its source database

    Please Login or Register  to view this content.
    Or mayby this formula will work if you put real dates in D1:O1
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

  4. #4
    Registered User
    Join Date
    11-18-2019
    Location
    Athens
    MS-Off Ver
    2016 - 2010
    Posts
    9

    Re: How to auto update a table when a change is happening to its source database

    I thank both of you for giving input into my question. I do, also, apologize for my delayed answer, but my schedule has been full.

    As far as your answers go, popipipo that a nice formula yo have provided there that changes the value on the 2nd sheet when a change is being made in the raw data sheet. However, the table doesn't dynamically change when rows are inserted or deleted. Although, i am glad you provided the formula.

    JeteMc. Your solution probably was the one that would have worked, however there are 2 obstacles. The first one is i do not know how to use power queries. For example i tried to change date's format to the european standard (DD/MM/YYYY) but i wasn't able to do it due to the fact that i have zero knowledge of Query, thus i was messing up constantly. If i learnt how to use this feature, probably i would be able to properly use it. Despite this, at work, unfortunately many pcs have the 2010 version of excel and i am not able to install this feature (i believe that it is not integrated with excel 2010). So even if i learnt that feature, i still wouldn't be able to apply a solution that resolves around Query.

    What you provided seems amazing and will help me learn Power query. Moreover, it seems that it does what i have asked for. I sincerely thank you for the time and effort you've put in this.

    I will leave the thread as unresolved in case you have any other suggestion that is not resolving around Power Query. If there isn't any, i will gladly mark it as Solved.

  5. #5
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: How to auto update a table when a change is happening to its source database

    I don't think that I did a very good job of explaining. I am not so much recommending the use of Power Query, although it is available as a free add in for the 2010 version of Excel, as I was suggesting setting up the data in a row by row format. I simply used Power Query to get the data into that state. After making the conversion one time, I suggest discontinuing the use of the matrix table (sheet 1) adding data to the new table (sheet 3) of the file attached to my post. I believe that the longer you use the matrix style table on sheet 1 the harder it will be to work with.
    I included the code in anticipation that the actual data table would contain more rows than that displayed on sheet 1. As long as that table is named Table 3 and the code is pasted into the advanced editor, it should convert the matrix table into a row by row table. If there are problems, you are welcome to upload your with names desensitized (you could later use find and replace to put them back) and I'll convert and send it back. Note that for .xlsx files the site limit is 1000 Kb, however .zip files may be considerably larger, although lately I have not been able to send very large .zip files for some reason.
    As to the date format I am not sure why that should happen as no special formatting was applied so that it should display according to your computer's/system's settings.
    Here is a link to a video presentation from one of the professors at Highline College concerning Power Query: https://www.youtube.com/watch?v=ohGFPF12Qwc&t=1275s
    Let us know if you have any questions.

  6. #6
    Registered User
    Join Date
    11-18-2019
    Location
    Athens
    MS-Off Ver
    2016 - 2010
    Posts
    9

    Re: How to auto update a table when a change is happening to its source database

    Thank you for the explanation. That helped a lot!

    Also, i apologize for the delayed response. The last few days of a year are never a nice working experience :P.

  7. #7
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,556

    Re: How to auto update a table when a change is happening to its source database

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pivot Table Auto Update Data Source?
    By Ket in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 08-20-2020, 02:05 PM
  2. Replies: 4
    Last Post: 02-15-2018, 09:42 AM
  3. Match data between CSV and database and update column in database table
    By djfscouse in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-05-2012, 05:59 PM
  4. change(update) pivot table data source.
    By Berserk in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2012, 08:21 AM
  5. Update the source database of a pivot table
    By manny_cb in forum Excel General
    Replies: 2
    Last Post: 10-16-2008, 06:18 PM
  6. Auto Update Source
    By Nolesphan30 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 01-30-2008, 04:42 PM
  7. [SOLVED] Change database source for pivot table
    By Neil in forum Excel General
    Replies: 3
    Last Post: 08-22-2005, 03:05 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1