def group_and_count_by_status(all_data):
    """
    Group by programme code and registration status and then
    count how many of each combination there are
    """
    grouped = all_data.groupby(['Prog Code', 'Dec/', 'App Cat']).size()
    grouped = grouped.sort_index()
    return grouped