How to Change X and Y Axis in Google Sheets
In this article
Yes, you can change the X and Y axis labels and ranges in Google Sheets. You do this by selecting the chart, clicking "Edit chart" in the three-dot menu, and using the "Customize" tab to rename or reconfigure the axes. This allows you to define exactly what data is plotted on the horizontal and vertical lines of your graph.
Before you begin, ensure your data is organized correctly in the spreadsheet. Google Sheets creates charts based on the range of cells you select. For a standard XY scatter plot or line chart, place your independent variable (the one you want on the X-axis, often time) in the first column and your dependent variable (the one you want on the Y-axis) in the adjacent column. Ensure there are no blank rows or columns within the data range, as these will break the axis scaling.
What You'll Need
- A Google account.
- A web browser (Chrome, Firefox, Safari, or Edge).
- Data in a Google Sheet formatted as a table or a clear range of rows and columns.
Step-by-Step
- Select your data. Click and drag your mouse to highlight the cells containing the data you want to visualize. This should include the column headers (labels) at the very top of the range. For example, if you have "Month" in A1 and "Sales" in B1, and data below them, select A1:B10.
- Insert the chart. With your data selected, look for the "Insert" menu at the top of the screen. Click it and choose "Chart." Google Sheets will automatically generate a chart based on the detected data types. It might default to a bar chart if it treats the data as categorical, or a line chart if it treats it as numerical.
- Open the chart editor. A small chart editor panel will appear on the right side of the screen. If it doesn't appear, double-click the chart itself. At the very top of this panel, you will see a dropdown menu labeled "Chart type." Click this to change the visualization if necessary, but for axis changes, we focus on the next option.
- Navigate to the Customize tab. Inside the chart editor, click on the "Customize" tab at the top. This is where all the fine-tuning of the chart's appearance and data structure happens. It is located between the "Setup" and "Chart style" sections.
- Expand the "Axes" section. On the left side of the Customize tab, look for a section labeled "Axes.” Click the small arrow next to it to expand the list. You will see two main options here: "Horizontal axis” and “Vertical axis.” These correspond to the X-axis and Y-axis, respectively.
- Change the Horizontal (X) Axis. Click on “Horizontal axis.” You will now see a list of options. To change the labels, look for the “Label” dropdown menu. By default, it might say “Use column A” or a similar description. Click this and select the specific column header you want to appear on the bottom of the chart (e.g., “Month”). To change the range of data shown, look for “Range” and select the specific cells you want to include in that axis. You can also uncheck “Include zero” if your data doesn't start at zero and you want a more accurate visual representation of the variance.
- Change the Vertical (Y) Axis. Click on “Vertical axis.” Just like with the horizontal axis, use the “Label” dropdown to rename what the numbers represent (e.g., “Revenue in USD”). In the “Range” section, you can force the axis to start at a specific number. For instance, if your data goes from 100 to 200, setting the range to start at 0 will stretch the graph and make the differences look smaller. Setting it to start at 100 will make the differences look more pronounced.
- Refine axis formatting (Optional). Within the “Vertical axis” options, you can further customize how the numbers look. You can change the number of decimal places, switch between different number formats (currency, percentage, scientific), or change the text color and font size to match your presentation needs.
Common Mistakes
One of the most common errors is mismatching the data columns when the chart editor defaults to a specific type. For example, if you select a range that includes text in the first column and numbers in the second, Google Sheets might try to plot the text as the X-axis and the numbers as the Y-axis, but this often results in an empty or confusing chart. Always ensure your independent variable (X-axis) is numerical or a date, and your dependent variable (Y-axis) is a value.
Another frequent issue occurs when users try to change the axis in the wrong place. The customization options for the axes are not always visible immediately when you first open the editor. You must click on the “Axes” label to expand the section; otherwise, the options for “Label” and “Range” will be hidden, and you won't be able to make the changes you need.
Users also often forget to update the chart range after adding new data to their spreadsheet. If you add a new row of data at the bottom of your table but don't update the chart’s data range in the editor, the chart will remain static, ignoring the new information. You can fix this by going back to the “Setup” tab in the editor and adjusting the “Data range” field to include the new cells.
Tips
For time-series data, the X-axis works best if you format the data in the spreadsheet as Dates. If you just type numbers like 1, 2, 3, 4, Google Sheets will treat them as simple categories. If you format them as Dates (Format > Number > Date), the X-axis will automatically label them correctly as January, February, etc., and the progression will be linear.
When working with financial data, it is highly recommended to use the “Format number” option under the Vertical axis settings to set it to Currency. This ensures that every user viewing the chart sees the same format, avoiding confusion where one person sees “$1,000” and another sees “1000.”
If you want to hide one of the axes entirely (for example, if you have a line chart and the horizontal axis numbers are just cluttering the view), you can uncheck the “Show axis” box within the specific Axis section in the Customize menu.
Troubleshooting
If your X or Y axis is not displaying the correct data, first check the “Setup” tab of the chart editor. Ensure that the “Data range” is selected correctly and that it includes the header row. Sometimes, if you have multiple charts on the same sheet, the editor might be looking at the wrong range. You can force it to select the exact cells you want by clicking the small spreadsheet icon next to the Data range box and dragging to highlight them.
If the axis labels are missing or not updating when you change the data in the sheet, try refreshing the chart. Click on the chart to make sure it is active, and then press the “F5” key on your keyboard. This will force the sheet to recalculate and redraw the chart with the latest data.
If you are trying to create a true scatter plot where both axes represent numerical variables, make sure you select the correct chart type from the “Chart type” dropdown in the Setup tab. Select “Scatter chart” instead of “Line chart,” as the scatter chart is designed to plot individual data points based on their X and Y coordinates rather than connecting them with lines.
If the numbers on your axis are not scaling correctly (for example, they are all the same size or the scale is too large), check the “Range” settings in the Axis section. You can manually set the minimum and maximum values. If you set a minimum value that is higher than your actual data, the chart will appear empty. Set the minimum to 0 or the lowest data point, and the maximum to the highest data point, to ensure the chart fills the available space.
Frequently Asked Questions
How do I change the X-axis to a date?
Format the cells in your data range as Dates using the menu (Format > Number > Date) before creating the chart. When you insert the chart, Google Sheets will recognize the date format and allow you to label the X-axis accordingly.
Can I have more than one Y-axis in Google Sheets?
Yes, you can. In the Chart editor, go to the Customize tab, expand the Axes section, and look for “Series.” Here, you can assign specific data series to the primary or secondary vertical axis. This is useful when plotting two different types of data with vastly different values on the same chart.
Why is my X-axis showing text instead of numbers?
This usually happens if your independent variable data is stored as text. Google Sheets treats text as categorical data. You can fix this by converting the text to numbers using the “Split text to columns” feature or by re-entering the data as numbers and formatting them as Dates if time-based.
How do I remove the gridlines?
Go to the Customize tab, expand the “Chart style” section, and uncheck the “Gridlines” box. You can also customize the gridlines individually by clicking on the “Gridlines” option within the Axes section to change their color or thickness.
Can I change the axis color?
Yes. In the Customize tab, under the Axes section, you can change the color of the axis text and the axis lines themselves by selecting the appropriate option and picking a color from the palette.
My chart is too squashed. How do I make the X-axis labels readable?
If the X-axis labels are overlapping, you can click on the chart to select it and then click the three-dot menu in the top right corner of the chart area. Select “Rotate chart” and choose a vertical orientation for the labels. Alternatively, you can reduce the font size of the axis labels in the Customize tab.