Hi all,
i have a sheet with various numbers of market shares in column A (e.g. 2.2%, 5%). Some of those shares can also be <1 (e.g. 0.0092%, 0.045, 0.033% etc.).
I need to copy those values into a Word-document. However, the values displayed in the Word-doc should only ever show decimals until the first non-zero decimal is displayed (with a minimum of 1 decimal being shown). Normally, I use "Increase Decimal" and "Decrease Decimal" under the Number options. That way, in the examples I listed, 0.0092% would show as 0.01%, 0.045 would show as 0.05 (as with the way I described, Excel rounds dynamically) and 0.033% would show as 0.03%.
Is there a formula (or some other way) to automate this task in column B, so I need only copy those results into my Word-doc?
The formula I could come up with, does not do the trick (the rounded values are incorrect), but the idea should be in there somewhere:
=IFERROR(IF(A4*100>1;ROUND(A4*100;1);IF(RIGHT(100*ROUND(A4;INT(1-LOG(A4)));1)>=5;100*ROUND(A4;INT(1-LOG(A4))-1);100*ROUND(A4;INT(1-LOG(A4;10))))&"%");"n.a.")
Thank you!
i have a sheet with various numbers of market shares in column A (e.g. 2.2%, 5%). Some of those shares can also be <1 (e.g. 0.0092%, 0.045, 0.033% etc.).
I need to copy those values into a Word-document. However, the values displayed in the Word-doc should only ever show decimals until the first non-zero decimal is displayed (with a minimum of 1 decimal being shown). Normally, I use "Increase Decimal" and "Decrease Decimal" under the Number options. That way, in the examples I listed, 0.0092% would show as 0.01%, 0.045 would show as 0.05 (as with the way I described, Excel rounds dynamically) and 0.033% would show as 0.03%.
Is there a formula (or some other way) to automate this task in column B, so I need only copy those results into my Word-doc?
The formula I could come up with, does not do the trick (the rounded values are incorrect), but the idea should be in there somewhere:
=IFERROR(IF(A4*100>1;ROUND(A4*100;1);IF(RIGHT(100*ROUND(A4;INT(1-LOG(A4)));1)>=5;100*ROUND(A4;INT(1-LOG(A4))-1);100*ROUND(A4;INT(1-LOG(A4;10))))&"%");"n.a.")
Thank you!