ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   add a double digit number together (https://www.excelbanter.com/excel-discussion-misc-queries/212422-add-double-digit-number-together.html)

adding double digit numbers

add a double digit number together
 
in one box I end up with a double digit number. I was these two numbers in
the double digit number to be added together and reduced till only one number
remains. I think it has something to do with integar numbers?

T. Valko

add a double digit number together
 
A1 = 37

=SUM(--MID(A1,{1,2},1))

returns 10 (3+7)

You'll need to explain in more detail what you mean by: reduced till only
one number remains.

--
Biff
Microsoft Excel MVP


"adding double digit numbers" <adding double digit
wrote in message
...
in one box I end up with a double digit number. I was these two numbers
in
the double digit number to be added together and reduced till only one
number
remains. I think it has something to do with integar numbers?




Rick Rothstein

add a double digit number together
 
Another way to do it...

=INT(A1/10)+MOD(A1,10)

--
Rick (MVP - Excel)


"adding double digit numbers" <adding double digit wrote in message ...
in one box I end up with a double digit number. I was these two numbers in
the double digit number to be added together and reduced till only one number
remains. I think it has something to do with integar numbers?


Rick Rothstein

add a double digit number together
 
If you want to do it with text functions, this seems like a simpler method to me...

=LEFT(H16)+RIGHT(H16)

--
Rick (MVP - Excel)


"T. Valko" wrote in message ...
A1 = 37

=SUM(--MID(A1,{1,2},1))

returns 10 (3+7)

You'll need to explain in more detail what you mean by: reduced till only
one number remains.

--
Biff
Microsoft Excel MVP


"adding double digit numbers" <adding double digit
wrote in message
...
in one box I end up with a double digit number. I was these two numbers
in
the double digit number to be added together and reduced till only one
number
remains. I think it has something to do with integar numbers?




Rick Rothstein

add a double digit number together
 
When you say "reduced till only one number remains", did you mean add the digits together and if that addition resulted in a 2-digit number, add them together and keep doing that until only a single *digit* remains? If so, use this...

=MOD(A1,9)+9*(MOD(A1,9)=0)

which will work on any number, not only 2-digit numbers.

--
Rick (MVP - Excel)


"adding double digit numbers" <adding double digit wrote in message ...
in one box I end up with a double digit number. I was these two numbers in
the double digit number to be added together and reduced till only one number
remains. I think it has something to do with integar numbers?


T. Valko

add a double digit number together
 
this seems like a simpler method to me...

Yeah, me too!


--
Biff
Microsoft Excel MVP


"Rick Rothstein" wrote in message
...
If you want to do it with text functions, this seems like a simpler method
to me...

=LEFT(H16)+RIGHT(H16)

--
Rick (MVP - Excel)


"T. Valko" wrote in message
...
A1 = 37

=SUM(--MID(A1,{1,2},1))

returns 10 (3+7)

You'll need to explain in more detail what you mean by: reduced till only
one number remains.

--
Biff
Microsoft Excel MVP


"adding double digit numbers" <adding double digit
wrote in message
...
in one box I end up with a double digit number. I was these two numbers
in
the double digit number to be added together and reduced till only one
number
remains. I think it has something to do with integar numbers?






Dana DeLouis[_3_]

add a double digit number together
 
till only one number remains.

From Number Theory on 9's...

=MOD(A1-1,9)+1

- - -
HTH :)
Dana DeLouis


adding double digit numbers wrote:
in one box I end up with a double digit number. I was these two numbers in
the double digit number to be added together and reduced till only one number
remains. I think it has something to do with integar numbers?


Roger Govier[_3_]

add a double digit number together
 
very nice, Dana
One small caveat, the number needs to be greater than 0.
0 or null return 9
=IF(A1<1,"",=MOD(A1-1,9)+1)



--
Regards
Roger Govier

"Dana DeLouis" wrote in message
...
till only one number remains.


From Number Theory on 9's...

=MOD(A1-1,9)+1

- - -
HTH :)
Dana DeLouis


adding double digit numbers wrote:
in one box I end up with a double digit number. I was these two numbers
in the double digit number to be added together and reduced till only one
number remains. I think it has something to do with integar numbers?



ob-server

add a double digit number together
 
can the double digit be as negative?

"adding double digit numbers" wrote:

in one box I end up with a double digit number. I was these two numbers in
the double digit number to be added together and reduced till only one number
remains. I think it has something to do with integar numbers?


Rick Rothstein

add a double digit number together
 
A couple of things. First, you accidentally left the equal sign in front of
the MOD function when you modified Dana's formula. Second, I agree that 0
should not return 9, but I don't think the empty string is correct either...
I would return 0 for 0. If negative numbers do not need to be considered,
then this...

=IF(A1="","",IF(A1=0,0,MOD(A1-1,9)+1))

And if negative numbers do need to be considered, something like this
maybe...

=IF(OR(A1<0,A1=""),"",IF(A1=0,0,MOD(A1-1,9)+1))

Another possibility, if negative numbers need to be considered, is to return
the sum of the digits without regard to the sign...

=IF(A1="","",IF(A1=0,0,MOD(ABS(A1)-1,9)+1))

or, do the above, but return the sign with it (which will save us the test
for 0)...

=IF(A1="","",SIGN(A1)*(MOD(ABS(A1)-1,9)+1))

--
Rick (MVP - Excel)


"Roger Govier" <roger@technology4unospamdotcodotuk wrote in message
...
very nice, Dana
One small caveat, the number needs to be greater than 0.
0 or null return 9
=IF(A1<1,"",=MOD(A1-1,9)+1)



--
Regards
Roger Govier

"Dana DeLouis" wrote in message
...
till only one number remains.


From Number Theory on 9's...

=MOD(A1-1,9)+1

- - -
HTH :)
Dana DeLouis


adding double digit numbers wrote:
in one box I end up with a double digit number. I was these two
numbers in the double digit number to be added together and reduced till
only one number remains. I think it has something to do with integar
numbers?




Roger Govier[_3_]

add a double digit number together
 
Hi Rick
A couple of things. First, you accidentally left the equal sign in front
of the MOD function when you modified Dana's formula.


Yes, my bad.
Thanks for picking it up.

--
Regards
Roger Govier

"Rick Rothstein" wrote in message
...
A couple of things. First, you accidentally left the equal sign in front
of the MOD function when you modified Dana's formula. Second, I agree that
0 should not return 9, but I don't think the empty string is correct
either... I would return 0 for 0. If negative numbers do not need to be
considered, then this...

=IF(A1="","",IF(A1=0,0,MOD(A1-1,9)+1))

And if negative numbers do need to be considered, something like this
maybe...

=IF(OR(A1<0,A1=""),"",IF(A1=0,0,MOD(A1-1,9)+1))

Another possibility, if negative numbers need to be considered, is to
return the sum of the digits without regard to the sign...

=IF(A1="","",IF(A1=0,0,MOD(ABS(A1)-1,9)+1))

or, do the above, but return the sign with it (which will save us the test
for 0)...

=IF(A1="","",SIGN(A1)*(MOD(ABS(A1)-1,9)+1))

--
Rick (MVP - Excel)


"Roger Govier" <roger@technology4unospamdotcodotuk wrote in message
...
very nice, Dana
One small caveat, the number needs to be greater than 0.
0 or null return 9
=IF(A1<1,"",=MOD(A1-1,9)+1)



--
Regards
Roger Govier

"Dana DeLouis" wrote in message
...
till only one number remains.

From Number Theory on 9's...

=MOD(A1-1,9)+1

- - -
HTH :)
Dana DeLouis


adding double digit numbers wrote:
in one box I end up with a double digit number. I was these two
numbers in the double digit number to be added together and reduced
till only one number remains. I think it has something to do with
integar numbers?




Dana DeLouis[_3_]

add a double digit number together
 
Hi. Just for fun ...
I didn't know this, but it appears the proper mathematical term is
called "Digital root"

One of many...
http://en.wikipedia.org/wiki/Digital_root

= = =
:)
Dana DeLouis



Roger Govier wrote:
Hi Rick
A couple of things. First, you accidentally left the equal sign in
front of the MOD function when you modified Dana's formula.


Yes, my bad.
Thanks for picking it up.


shg[_28_]

add a double digit number together
 

MOD(A5-1,9) returns an error for N = 1,207,959,553.

You can use instead =A1 - FLOOR(A1 - 1, 9)


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=36795


Dana DeLouis[_3_]

add a double digit number together
 
Hi. Just in case that limit was done by trial-n-error, Microsoft admits
the error will occur like you said at:

9*2^27

1207959552

I really wish they would fix it.

Not related to the op's question, but as a side note, people have posted
a lot of programs to test if a number
is prime. I just added one more test to my number-theory routines based
on that article...

n = 98789987654343

Is this number prime?

DigitalRoot(n)

9

Hence, the number can not be Prime, and no further testing is necessary.

= = =
Dana DeLouis




shg wrote:
MOD(A5-1,9) returns an error for N = 1,207,959,553.

You can use instead =A1 - FLOOR(A1 - 1, 9)




shg[_29_]

add a double digit number together
 

DigitalRoot(n) = 9

Hence, the number can not be Prime, and no further testing is
necessary.

Clever ...


--
shg
------------------------------------------------------------------------
shg's Profile: http://www.thecodecage.com/forumz/member.php?userid=13
View this thread: http://www.thecodecage.com/forumz/sh...ad.php?t=36795



All times are GMT +1. The time now is 08:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com