def get_group_from_table(metatable_dict_entry):
    """
    Return the appropriate group title based on either the SGID table name or
    the shelved category.
    """

    sgid_name, _, item_category, _ = metatable_dict_entry

    if item_category == 'shelved':
        group = 'UGRC Shelf'
    else:
        table_category = sgid_name.split('.')[1].title()
        group = f'Utah SGID {table_category}'

    return group