def SUMIF(a, cond, b=[]): a, b = _flatten(a), _flatten(b) if not b: b = a n = 0 o_cond = cond if "<" not in str(cond) and ">" not in str(cond): cond = " == " + str(cond) for i in range(len(a)): try: if eval(str(a[i]) + cond): n += float(b[i]) except: if eval(str(a[i]) + "== '" + o_cond + "'"): n += float(b[i]) return n
def SUMIF(a, cond, b = []): a,b = _flatten(a),_flatten(b) if not b: b = a n= 0 o_cond = cond if "<" not in str(cond) and ">" not in str(cond): cond = " == "+str(cond) for i in range(len(a)): try: if eval(str(a[i]) + cond): n+= float(b[i]) except: if eval(str(a[i]) + "== '"+o_cond+"'"): n+= float(b[i]) return n
def SUMPRODUCT(*list): n = 0 for i in range(len(list)): _n = 1 for l in list: _n *= _flatten(l)[i] n += _n return n
def SUMPRODUCT(*list): n = 0 for i in range(len(list)): _n = 1 for l in list: _n*=_flatten(l)[i] n+=_n return n
def SERIESSUM(x, n, m, a): a = _flatten(a) r = 0 for i in range(len(a)): r += a[i] * (x**(n + m * i)) return r
def SERIESSUM(x, n, m, a): a = _flatten(a) r = 0 for i in range(len(a)): r += a[i]*(x**(n+m*i)) return r