How to Set an Excel Chart Axis Maximum Based on Today's Date
Question details
The user wants to create a dynamic Excel chart where the axis and plotted data automatically update to display information only through the last completed month based on today's date.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Creating an automated dashboard or report chart that stops plotting data at the end of the previous month without requiring manual updates.
- Observed behavior
- By default, charts plot all selected data, including future dates or blanks, making the chart look incomplete. The goal is to dynamically hide uncompleted months from the chart axis.
Ensure your original dataset contains a continuous column of dates. It is highly recommended to format your source data as a structured Table (Ctrl+T) so the ranges expand automatically as new data is added.
Use a Derived Table with the NA() Function
Create a secondary data table that uses an IF formula to return actual values for completed months and the #N/A error for future dates, which Excel charts ignore.
Excel charts will plot blanks and zeros as actual data points, causing your line or bar to drop to the bottom of the axis. However, Excel ignores the #N/A error. By substituting future data with NA(), the chart automatically limits itself to past data.
Select your original data range (Dates and Values) and press Ctrl+T to convert it into a structured Table.
In an empty area of your worksheet, copy the headers of your original table to begin building a derived table.
Under the new Date header, link to your original dates. Under the Value header, enter a formula that checks the month. For example: =IF(EOMONTH(A2,0)<EOMONTH(TODAY(),-1), B2, NA()). This evaluates if the date belongs to a previously completed month.
Select the derived table range, navigate to the Insert tab on the ribbon, and choose your preferred chart type. The chart will only display data for the completed months.

Use Dynamic Named Ranges
Define mathematical ranges in the Name Manager using OFFSET and COUNTIF to feed only completed month dates into the chart.
Easily Create Dynamic Charts with WPS Office
WPS Spreadsheet provides powerful charting capabilities, full support for structured tables, and seamless integration with the NA() function, allowing you to build dynamic, automated dashboards effortlessly.
- 1. Organize Your Data: Open your dataset in WPS Spreadsheet, select it, and press Ctrl+T to format it as a Table.
- 2. Add a Helper Column: Create a new column and use the formula =IF(MONTH(A2)<MONTH(TODAY()), B2, NA()) to filter out future dates.
- 3. Insert Chart: Go to the Insert tab, select 'Chart', and choose your preferred visualization. Your chart is now dynamic.

Frequently Asked Questions
Why does my dynamic chart drop to zero instead of stopping at the last month?
If your IF formula returns a blank string ("") or a zero for future dates, Excel will still plot them as zeros on the chart axis. You must use the NA() function to generate a #N/A error, which the chart engine recognizes and ignores.
Will my dynamic chart update automatically when the current month changes?
Yes. Because the logical check utilizes the TODAY() function, the spreadsheet evaluates the current system date every time it recalculates. When a new month begins, the chart will automatically update to include the newly completed month.
Can I adjust this method to show data up to yesterday instead of the end of the month?
Absolutely. You can modify your IF condition to evaluate days instead of months. For example, changing the formula to =IF(A2<TODAY(), B2, NA()) will ensure the chart plots data strictly up to the day before the current date.
Do dynamic charts created with NA() work when opened in WPS Office?
Yes, WPS Spreadsheet is fully compatible with Excel's formula engine and chart behaviors. Files utilizing the NA() trick for dynamic charting will function exactly the same in WPS Office.




