Forum Discussion
Help With Excel Line Graph "Switches"
- 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:
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.
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:
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.
- ExplainLikeIm7Aug 26, 2025Copper Contributor
Sounds easy enough. Thank you for your assistance, I'll have a crack and see what sticks