Tomas,
I will try to keep the formula relatively simple: a first IF that checks the
input ranges, and the second IF returns values. Still, there isn't any way
to handle the sum of 19 (your last case), since two numbers that are 9 or
less _cannot_ add up to 19.
=IF(OR(A1<1,A19,A2<1,A29),"ERROR!",IF(A1+A2<10,A 1+A2,A1+A2-9))
HTH,
Bernie
MS Excel MVP
"Tomas" wrote in message
...
Bernie,
thanks a lot, this was helpful but I noticed I need to ask the right
question in order to get the right answer. So here it is what I want to
get:
A1 + A2 = B2
IF A1 + A2 = 2 THEN B2 = 2
IF A1 + A2 = 3 THEN B2 = 3
and so on
IF A1 + A2 = 9 THEN B2 = 9
IF A1 + A2 = 10 THEN B2 = 1
IF A1 + A2 = 11 THEN B2 = 2
IF A1 + A2 = 12 THEN B2 = 3
IF A1 + A2 = 13 THEN B2 = 4
IF A1 + A2 = 14 THEN B2 = 5
IF A1 + A2 = 15 THEN B2 = 6
IF A1 + A2 = 16 THEN B2 = 7
IF A1 + A2 = 17 THEN B2 = 8
IF A1 + A2 = 18 THEN B2 = 9
IF A1 + A2 = 19 THEN B2 = 1
( A1 and A2 must have a value between 1 and 9 otherwise ERROR!)
Thank you VERY much!!!
Tomas
"Bernie Deitrick" wrote:
Tomas,
If A is cell A1, and B is in cell B1, then in cell D1, use the formula
=IF((A1+B1)9,MOD(A1+B1,9)+ IF(MOD(A1+B1,9)=0,10,0),"")
Not sure if your pattern is meant to continue on indefinitely....
HTH,
Bernie
MS Excel MVP
"Tomas" wrote in message
...
How would I do the following:
A+B = C,
if C = 10 then D = 1
if C = 11 then D = 2
C = 12 then D = 3
and so on
C = 19 then D = 1
thank you!
__________________________________________________ _______________
|