# Create variable length table determined by input value

#### Bruzah

##### New Member
Using Excel 2010

I need to create a table (report) that will vary in length depending on the number of months determined by the user.

In separate cells I have a "Start Month" (e.g. January 2016) and an "End Month" (e.g. March 2016); these are both selectable from a drop down list sourced from a range of dates elsewhere in the spread sheet.

I have a cell (A13) which calculates the number of months between the two dates (=(YEAR(EndDateMthly)-YEAR(StartDateMthly))*12+MONTH(EndDateMthly)-MONTH(StartDateMthly)+1) so if the user was to select the Start Month and End Month as in example above this would give the result of 3 in cell A13. If both dates were January 2016, this would return a value of 1.

So if I have a "Start Month" (e.g. January 2016) and an "End Month" (e.g. March 2016) then I would need the report to be 3 rows high, with a one row for each of the months. See example below.

 MONTH 30 Days 60 Days 90 Days 180 Days January 2016 10 20 30 40 February 2016 15 25 35 45 March 2016 10 11 12 13

<tbody>
</tbody>

If both Start Month and End Month were to be January 2016 then the table would look like
 MONTH 30 Days 60 Days 90 Days 180 Days January 2016 10 20 30 40

<tbody>
</tbody>

I am using VLOOKUP's to find the data in other columns (30, 60, 90, 180 Days), but I cannot find a way to make the number of rows presented in the table variable based on the number of months input parameter.

I obviously also need to be able to ensure my VLOOKUP's cover the same range of dates selected by the user. I don't expect the user to select a date range of greater than 24 months.

Lastly, I need to have several of these variable months reports on the same tab in the spread sheet one above the other, so would need to be able to move the subsequent reports up and down depending on the number of months selected to avoid the reports overlapping each other.

Any suggestions would be much appreciated.

FYI - I'm an intermediate user of excel so I hope I'll be able to understand any replies to this post.

### Excel Facts

If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.

Replies
0
Views
169
Replies
3
Views
191
Replies
1
Views
120
Replies
16
Views
322
Replies
0
Views
77

1,136,642
Messages
5,676,960
Members
419,665
Latest member
allsmilees2

### 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.

### Which adblocker are you using?

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

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