mdavide
Board Regular
- Joined
- Oct 19, 2004
- Messages
- 211
hi all,
well I don't have a real problem but just a curiosity: i'm looking for a better way to treat some percentage.
i'm working with an array, like this one:
2 3 1 2
the sum is 7 wich I consider like a net value; I have another input, that is a gross value (for this ex I say 10).
The problem is: I have to split the difference between the net and the gross value (10-7=3) inside the array in a proportional way.
the problem seems so simple, like I tought before, but I'm not able to trait it without using a lot of heavy code lines. there are problems with integer values, with approximation and with the final sum value that might be exactly 10.
I'm lookink for vba suggestion, I hope that what i wrote is enough clear.
many thanks.
DM
well I don't have a real problem but just a curiosity: i'm looking for a better way to treat some percentage.
i'm working with an array, like this one:
2 3 1 2
the sum is 7 wich I consider like a net value; I have another input, that is a gross value (for this ex I say 10).
The problem is: I have to split the difference between the net and the gross value (10-7=3) inside the array in a proportional way.
the problem seems so simple, like I tought before, but I'm not able to trait it without using a lot of heavy code lines. there are problems with integer values, with approximation and with the final sum value that might be exactly 10.
I'm lookink for vba suggestion, I hope that what i wrote is enough clear.
many thanks.
DM