iwaddo
Jun 24, 2024Copper Contributor
How do I add or sum until?
If my input is 20, I want to add back up a column sequential until I've reached >=20
Examples, if the column is
- 5, 10, & 12, I need 100% of the 5, 100% of the 10 & only 41.66% of the 12
- 10 & 10, I need 100% of each 10
- 5, 5, 5, 10, I need 100% of each 5 and 50% of the 10
I have looked at a nested if but it started to get complicated and difficult to read and debug.
Is there a good way to tackle this problem?
Thank you for your help.