Forum Discussion

ExplainLikeIm7's avatar
ExplainLikeIm7
Copper Contributor
Aug 23, 2025
Solved

Help With Excel Line Graph "Switches"

I apologize if this query has already been raised before. I have been tasked with creating a graph that compares data across multiple years. With how cluttered the graph is becoming, I was curious if...
  • m_tarler's avatar
    Aug 25, 2025

    you can look at using slicers and filters and such but otherwise you can also use 'helper' columns that pull the data you want and then graph those columns of data.  So if A1:A100 is for 2024 and B1:B100 is for 2025 then in C1 you have =IF(D1=2024, A1:A100, B1:B100) then you plot C1:C100  then just change D1 from 2024 to 2025 accordingly.  (this is obviously simplified but gives the idea).  If the length of those data set may vary then you consider using a named dynamic range for the graph.  Here is a reference for how to do that:

    https://learn.microsoft.com/en-us/troubleshoot/microsoft-365-apps/excel/defined-names-to-update-chart-range 

    that said, if you search for excel graph dynamic range you will find plenty of sites and videos that may be even easier to understand.

    hope that helps.

Resources