What you described is not a great setup, you probably understand it yourself.
A 2D array or JSON would be much easier to work with, to edit and store data.
With 18 instance variables there are basically only two solutions:
1. Use a bit of Javascript to retrieve the variable value by name:
runtime.objects.spriteName.getFirstPickedInstance().instVars["var_name"])
2. Check all variables one by one, until you find the right one:
Let's say you store the selected year in vTime global variable, and want to extract the result into instance varible vResult.
For Each Sprite
If vTime="Year_2024" : Sprite set vResult to Self.Year_2024
Else If vTime="Year_2023" : Sprite set vResult to Self.Year_2023
Else If vTime="Year_2022" : Sprite set vResult to Self.Year_2022
Else If vTime="Year_2021" : Sprite set vResult to Self.Year_2021
.....
You can compress that into one action if you use ternary operators:
For Each Sprite
Sprite set vResult to (vTime="Year_2024" ? Self.Year_2024 : vTime="Year_2023" ? Self.Year_2023 : vTime="Year_2022" ? Self.Year_2022 : ......)