Populate table dynamically

Robert Casaletta
Robert Casaletta used Ask the Experts™
I have a table that is generated from a data source.  The table is based on a 6-month time frame.  My challenge is how to populate the table if I do not have all 6-months of available.  So if I have 3-months of data, then they those 3-months would be displayed reading left-to-right, with the oldest in the left most column.

I have played with nested IF statements, but with no success.

Attached is a small example of my data with a table showing 4 of the 6 months and one with all 6-months. Table_With_Moving_Data_EE.xlsx
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Mechanical Engineer
Most Valuable Expert 2013
Top Expert 2013
I put the following formulas in cells G1 & G2, then copied across.

Open in new window

Note that you need to edit the formulas (except the one for dates) when you bring back data from other tables.

The generic task that you are performing is called "pivoting the data". You can do it without formulas using a series of PivotTables.

It is also possible to pivot the data using PowerQuery add-in (now found under Data...Get and Transform in Excel 2016 and later).
NorieAnalyst Assistant


Couldn't you use a simple SUMIF?

Robert CasalettaManager, Warranty Performance


Thank you! Works great!  I will read up on the use of the aggregate function and pivoting the data.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial