Пример #1
0
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
Пример #2
0
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
Пример #3
0
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
Пример #4
0
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
Пример #5
0
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
Пример #6
0
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