from functools import reduce


def excel_column_index(name):
    """Takes the Excel-style name of a column and returns its 0-based index.

    >>> excel_column_index('A')
    0
    >>> excel_column_index('B')
    1
    >>> excel_column_index('Z')
    25
    >>> excel_column_index('AA')
    26
    >>> excel_column_index('AZ')
    51
    >>> excel_column_index('BC')
    54
    """

    A = ord('A')
    return reduce(lambda acc, c: acc * 26 + (ord(c) - A + 1), name, 0) - 1