def add(iterable, ignore=False):
    """Sums iterable. If ignore=True all elements except those that are None are added. If ignore=False, None is returned if any element is None. """
    x = None
    for i in range(len(iterable)):
        if not iterable[i] is None:
            if x is None:
                x = iterable[i]
            else:
                x = x + iterable[i]
        elif not ignore:
            return None
    return x
