In Excel: in Excel desktop on Windows or Mac, use an XY scatter chart with straight lines. Add a two-point series with the same numeric X value and the lower and upper Y values of the vertical axis.
On this page7
Use an XY scatter chart for the original data, with numeric X values or real Excel dates.
Create two helper rows: repeat the reference X value and enter the intended lower and upper Y bounds.
Select the chart, open Chart Design ▸ Select Data ▸ Add, and assign the two helper X and Y ranges to the new series.
Set that series to Scatter with Straight Lines; remove its markers if only the line is needed.
Match the helper Y values to the axis bounds and check the reference X position before hiding any helper data.
What this does
A vertical reference line marks one numeric X position, such as an event date or a threshold. Its two endpoints share X while Y spans the plot. A standard Line chart uses category positions; use a numeric or real-date XY axis for this workflow. This does not rotate the chart or add another time-series trend. Before you run it on a workbook other people depend on, try it on a copy or a few rows first. Undo only reaches back through the current session, so a quick trial run is the cheapest way to see exactly what will change before the file is saved and shared. Treat “vertical line graph excel” as a small repeatable workflow rather than a one-off click you hope to remember next time. Use a small test block before the live file, so any surprise in the affected chart shows up while it is still harmless. When this is a ribbon command, the selection matters more than the button: confirm the range, apply the command, then spot-check the output before saving. That turns a visual that makes the number obvious at a glance into a method you can reuse, explain, and defend when the workbook leaves your screen.
A worked example
Put X values 3 and 3 in E2:E3 and Y values 0 and 100 in F2:F3. In an XY chart with Y bounds 0 and 100, add E2:E3 as Series X values and F2:F3 as Series Y values. Choose Scatter with Straight Lines for this series. The segment runs vertically at X=3 from Y=0 to Y=100. Use the reference line to locate an event or threshold against the plotted measurements. When the result is not what you expected, undo straight away rather than repairing it by hand — undo restores the sheet exactly, while manual fixes tend to leave small inconsistencies behind that surface later.
In Google Sheets
This is a command rather than a formula, so there is no syntax to carry over. Google Sheets arranges its commands in menus across the top instead of a ribbon, names some of them differently and does not have every Excel command — look for the equivalent in the Sheets menus or its help before assuming the steps match. Keep this page bookmarked for the next time the same question comes up. Better still, repeat the steps once in your own workbook — doing it yourself is what turns a copied answer into something you remember. If you take one thing from this page on “vertical line graph excel”, make it the order of checks rather than the individual clicks: confirm what is selected, apply the step, and look at the result before moving on. That small routine is what keeps Excel work predictable when the same task comes back in a slightly different workbook.
Common mistakes
- Adding a standard Line series and expecting its category positions to behave like numeric X values.
- Using different X values at the two endpoints, which creates a sloped line.
- Changing the axis bounds without updating the helper endpoints.
- Using text dates instead of real date values for the XY horizontal axis.
Frequently asked questions
Why is my reference line diagonal?
The endpoints have different X values. Repeat the same reference X in both helper rows.
Does this work on a category Line chart without changes?
This workflow uses an XY axis. Category-axis charts require a deliberate conversion or separately aligned axes; do not copy category numbers as if they were numeric X coordinates.
Can I mark an event date?
Use real Excel dates as the XY X values and repeat the event date for both endpoints. Format the horizontal axis as dates.