def find_index(column_name, row, error_msg):
    """
    Find what column has the specified label.

    The search is case insensitive.

    Args:
        column_name: Column label to search for
        row: The row with the headers for this table, typically the first.
        error_msg: Error message to raise with ValueError.

    Returns:
        Index of the column with the specified name.

    Raises:
        ValueError: If no column named column_name can be found.
    """
    for i, cell in enumerate(row):
        if cell.strip().lower() == column_name.lower():
            return i
    else:
        raise ValueError(error_msg)