ThrottleWorks
Excel Ninja
Hi,
I need help for formatting Numeric value.
I faced this issue while working on the “Convert” function.
While using this function the result generated were such as 1.001, 1.0001, 1.00000004 or 1.000000000005.
I have to keep increasing the Decimal to see the exact value, if I did not increase the Decimal, the values will get populated as 1 only.
There were more than 230 cells which I have to format manually to see the exact value.
Some of the cells required decimal points up to 22 or some of them required just 1 Decimal point.
Though I completed this formatting & the issue is not troubling me now.
I was thinking can we automate this with Formula or VBA.
For example, the value 1.00005 will need 5 Decimal points to show the exact result.
Less decimals will show the value as 1 only.
If we can design a code, which will check if the value is not whole number and right most value after the decimal is 0 then keep increasing the decimal.
For example, we can have a value as 5 only, this does not require decimal points, but the values 5.0001 will require 4 decimal points.
This is not a real life problem for me, but I was wondering if anyone here has worked on such issue earlier.
Any help is welcome.
The only vague idea comes to my mind is, Do While Loop may be useful here.
If the value after decimal point is equal to 0 then keep increasing the decimal till it is greater than 0.
But I do know how to I write this in a code and also, what if the values is a whole number, does not require decimal at all !
I need help for formatting Numeric value.
I faced this issue while working on the “Convert” function.
While using this function the result generated were such as 1.001, 1.0001, 1.00000004 or 1.000000000005.
I have to keep increasing the Decimal to see the exact value, if I did not increase the Decimal, the values will get populated as 1 only.
There were more than 230 cells which I have to format manually to see the exact value.
Some of the cells required decimal points up to 22 or some of them required just 1 Decimal point.
Though I completed this formatting & the issue is not troubling me now.
I was thinking can we automate this with Formula or VBA.
For example, the value 1.00005 will need 5 Decimal points to show the exact result.
Less decimals will show the value as 1 only.
If we can design a code, which will check if the value is not whole number and right most value after the decimal is 0 then keep increasing the decimal.
For example, we can have a value as 5 only, this does not require decimal points, but the values 5.0001 will require 4 decimal points.
This is not a real life problem for me, but I was wondering if anyone here has worked on such issue earlier.
Any help is welcome.
The only vague idea comes to my mind is, Do While Loop may be useful here.
If the value after decimal point is equal to 0 then keep increasing the decimal till it is greater than 0.
But I do know how to I write this in a code and also, what if the values is a whole number, does not require decimal at all !