def convert_value(value, idx_map, year_ref, year_new ,index):
    """
    Converts given value from the reference year to the desired year using the given index and index map
    :param value: Float with the original value
    :param idx_map: Index map generated with create_index_map
    :param year_ref: Year of the reference value
    :param year_new: Desired yeaar
    :param index: Desired Index name
    :return:  New value
    """
    ref_idx = idx_map.loc[(idx_map["YEAR"] == year_ref), index].values[0]
    new_idx = idx_map.loc[(idx_map["YEAR"] == year_new), index].values[0]
    return value * new_idx / ref_idx