kelly mort
Well-known Member
- Joined
- Apr 10, 2017
- Messages
- 2,169
- Office Version
- 2016
- Platform
- Windows
Hello,
I need help with this algorithm. I have a cell say A2 that contains a given number and I want to use these rules for it:
(1). Sum all the characters up
(2). If the result form the sum is more than a 1-digit number, then we sum the characters of our result up again till we get a single digit answer.
The numbers 11 and 22 are excluded. That is, when our sums yield 11 or 22, we should skip the further sums.
(3). When the result has reached 11 or 22 or a single digit from the other non-single digit numbers, then display that on a message box or the immediate window.
These are sample examples of output I am looking for:
So for 181991 result is 11
So for 281991 result is 3
So for 887988 result is 3
I need help with this algorithm. I have a cell say A2 that contains a given number and I want to use these rules for it:
(1). Sum all the characters up
(2). If the result form the sum is more than a 1-digit number, then we sum the characters of our result up again till we get a single digit answer.
The numbers 11 and 22 are excluded. That is, when our sums yield 11 or 22, we should skip the further sums.
(3). When the result has reached 11 or 22 or a single digit from the other non-single digit numbers, then display that on a message box or the immediate window.
These are sample examples of output I am looking for:
Code:
1. 181991 = 1+8+1+9+9+1 = 29 = 2+9 = 11
2. 281991 = 2+8+1+9+9+1 = 30 = 3+0 = 3
3. 887988 = 8+8+7+9+8+8 = 48 = 4+8 = 12 = 1+2 = 3
So for 281991 result is 3
So for 887988 result is 3