Nope, not that method.
I get the percentages from a website and then I have to first convert them to fraction which the website had before.
The company that then receives my data wouldn't want me to use percentages but fractions. Because they use that data to show the results to many more people.
The only 100% match as they want it is to use fractions like Excel does.
But the thing is that lower percentages match 0 which is never true, then I have to adjust fractions in Excel up to two digits. E.g 2% is not 0 nor 2/100 but 1/50. It seems dumb but it is as it is, lol.
If I adjust the D values in the code above then higher percentages mess up to rare big numbers.
It seems that the method I am after when I test in Excel would be:
If percentage doesn't result in 0 then use up to one digit fraction. 50% 1/2.
If percentage matches 0 then another level up one digit to now use up to two digits. 2% is 1/50
I add an image from google to show the menu I refer to.
It looks so simple in Excel but so hard to do as it does
If I open and empty Excel file, maybe I could use ComObj to send date, format it and then receive back.
I will test some hundred first and see how big a problem this can be for as it is today.
- image.png (57.68 KiB) Viewed 1055 times