andreascostas
Board Regular
- Joined
- Jan 11, 2011
- Messages
- 150
I want to Randomly generate a number from thousand to hundred thousand, and then decomposed it.
Example, input in cell A1: 234,789
Output in cell B1: 2 hundred thousands + 3 ten thousands + 4 thousands + 7 hundreds + 8 tens + 9 ones
Another example input in cell A1: 207,089 and output in B1: 2 hundred thousands + 7 thousands + 8 tens + 9 ones
Or A1: 23,005 output in B1: 2 ten thousands + 3 thousands + ones
In other words, I need it to accommodate zero digits without listing them. I can use left and right functions to do the ones that have no 0 in any of the digits, but am having trouble with examples like the Second and third example. Can a udf be written to accomplish this that can do multi[le ones at the same time?
Example, input in cell A1: 234,789
Output in cell B1: 2 hundred thousands + 3 ten thousands + 4 thousands + 7 hundreds + 8 tens + 9 ones
Another example input in cell A1: 207,089 and output in B1: 2 hundred thousands + 7 thousands + 8 tens + 9 ones
Or A1: 23,005 output in B1: 2 ten thousands + 3 thousands + ones
In other words, I need it to accommodate zero digits without listing them. I can use left and right functions to do the ones that have no 0 in any of the digits, but am having trouble with examples like the Second and third example. Can a udf be written to accomplish this that can do multi[le ones at the same time?