Add logic to identify all_years or year_range cases