I'm in need of a formula in any programming language that would give me a value that I could ultimately sort by. I have 2 variables:
- variable 1 = just some arbitrary count (could be something like 0, 1, 5, 20, 50, 100)
- variable 2 = number of days that passed since current date (could be 0, 1, 2, 50, 100)
I'm in need of a weighted custom formula where:
- between 0-30 days from current date, variable 1 (count) starts at 100% weight and variable 2 at 0% weight. As each day passes up to 30 days, variable 1 weight goes down to 50% on day 30 and variable 2 (number of days passed) increases from 0% to 50% on day 30
- between 31-60 days from current date, variable 1 starts increasing from 50% to 100% peaking at day 60 and variable 2 starts decreasing to 0 and goes to 0 on day 60
- beyond day 60, variable 1 is always at 100% and variable 2 obviously at 0%