How to Plot Two Data Columns as One Continuous Line in Excel
Question details
The user needs to plot paired initial and final values from the same row into a single continuous line chart.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating a dynamic continuous line chart from horizontal paired data (such as initial and final capacity values) that automatically updates when new table rows are added.
- Observed behavior
- Excel line charts require data to be in a single vertical series to plot continuously, so horizontal pairs plotted directly will appear as separate series or broken lines rather than a continuous trend.
Ensure your original dataset is formatted as an official Excel Table so that dynamic array formulas can automatically detect and include new rows when they are added.
Reshape Data Using Dynamic Array Formulas and Named Ranges
Use the TOCOL and HSTACK functions to convert horizontal data pairs into vertical columns, then feed them into the chart using dynamic Named Ranges.
To make a line chart continuous, the X and Y coordinates must be stacked vertically. Using Excel's dynamic array functions allows you to restructure the data without manually copying and pasting.
By defining Named Ranges with the spill operator (#), your chart will dynamically scale its axis whenever new data points are added to the original table.
Select your entire dataset, go to the Insert tab, and click Table (or press Ctrl+T). In the Table Design tab, rename the table to 'Data'.
On a new worksheet named 'Plot data', enter the formula =TOCOL(HSTACK(Data[Date],Data[Date])) in cell A2 to create the vertical X-axis dates. In cell B2, enter =TOCOL(Data[[SCi]:[SCf]]) to stack the paired initial and final Y-axis values.
Navigate to Formulas > Name Manager and click New. Create a name called 'Plot_Year' and set its reference to ='Plot data'!$A$2#. Create another name called 'Plot_SpecCapacity' referring to ='Plot data'!$B$2#.
Go to Insert > Line Chart to insert a blank chart. Right-click it, select 'Select Data', and add a new series. Set the Series X values to ='Plot data'!Plot_Year and the Y values to ='Plot data'!Plot_SpecCapacity.

Easily Reshape Data and Create Continuous Charts in WPS Spreadsheet
WPS Spreadsheet fully supports dynamic array formulas and advanced charting, allowing you to seamlessly transform complex row data into beautiful continuous line charts without compatibility issues.
- 1. Open Your Dataset: Launch WPS Spreadsheet and open the workbook containing your paired row data.
- 2. Apply Dynamic Array Formulas: Use the TOCOL and HSTACK functions in a blank column to seamlessly stack your horizontal pairs vertically.
- 3. Select the Reshaped Data: Highlight your newly generated vertical X and Y columns.
- 4. Insert the Line Chart: Navigate to the Insert tab, click on Chart, select Line Chart, and customize the layout directly from the right-side properties panel.

Frequently Asked Questions
Why does my line chart show two separate lines instead of one continuous line?
By default, spreadsheet software creates a separate data series for each column. To plot them as a single continuous line, you must restructure the paired data points from horizontal columns into a single vertical column before inserting the chart.
What is the purpose of the TOCOL function in this scenario?
The TOCOL function transforms an array or a multi-column range into a single vertical column. In this case, it takes the horizontal initial and final values on each row and stacks them sequentially into one continuous vertical list for accurate plotting.
Why do I need to use the '#' symbol when defining Named Ranges?
The '#' symbol is the spill range operator. It tells the Named Manager to refer to the entire dynamically generated array of data starting from that cell, ensuring your chart's data source automatically expands or shrinks when the original table changes.




