Forum Discussion
DegenS
Feb 14, 2024Copper Contributor
Adding amounts to the total based on rules for decimals?
I'm trying to figure out a way to write a function that would take a value with up to 4 decimal places and either add 0, 1, 2, or 3 to the end total depending on the following criteria: If the amo...
HansVogelaar
Feb 14, 2024MVP
Let's say the values such as 72, 74, 82 and 89 are in D2 and down.
In another cell in row 2:
=LET(val, D2, base, 3*QUOTIENT(val, 24), mod, MOD(val, 24), extra, (mod>=12)+(mod>=10)+(mod>=8), base+extra)
Fill down.
- DegenSFeb 21, 2024Copper Contributor
Thanks for your help. It does seem my home office version does not support LET function (2016).
But I can use this at my office.
I did not think this formula would be so complicated. I honestly thought I was missing something simple! Thank you again 🙂
- HansVogelaarFeb 21, 2024MVP
Here is a formula that should work in Excel 2016 too:
=3*QUOTIENT(D2, 24)+(MOD(D2, 24)>=12)+(MOD(D2, 24)>=10)+(MOD(D2, 24)>=8)
- DegenSFeb 21, 2024Copper ContributorWow!! Above and beyond helping me!! Thank you so very much!
(Sorry about the excessive use of exclamation marks but omg you have saved me hours of work!)