Task

Take a   Natural Number   in a given base and return the sum of its digits:

   110         sums to   1
   123410   sums to   10
   fe16       sums to   29
   f0e16     sums to   29


digitSum
=LAMBDA(s,
    FOLDROW(
        LAMBDA(a,
            LAMBDA(c,
                a + digitValue(c)
            )
        )
    )(0)(
        CHARSROW(s)
    )
)
 
 
digitValue
=LAMBDA(c,
    LET(
        ic, UNICODE(MID(c, 1, 1)),
 
        IF(AND(47 < ic, 58 > ic),
            ic - 48,
            IF(AND(64 < ic, 91 > ic),
                10 + (ic - 65),
                IF(AND(96 < ic, 123 > ic),
                    10 + (ic - 97),
                    0
                )
            )
        )
    )
)