Highlighted

## Future Value calculation/expression in After Effects

New Here ,
Sep 16, 2020

Copied

Hi guys,

Excel has a function called Future Value, it looks like this:

Future Value (rate, nper, pmt, [pv], [type])

 rate - The interest rate per period. nper - The total number of payment periods. pmt - The payment made each period. Must be entered as a negative number. pv - The present value of future payments. If omitted, assumed to be zero. Must be entered as a negative number. type - When payments are due. 0 = end of period, 1 = beginning of period. Default is 0.

I'm looking for a way to replicate this calculation within after effects in order to see a realtime calculation as I animate.

Any help greatly appreciated,

Marc

You would need to use the actual formula for future value.

Make variables for each thing and then pop them together into a formula. Your formula seems a little different than the ones I found by Googling, but you can probably find one and build your expression pretty easily.

The one I found was FV = PV (1 + r)n

Future Value was present value times 1 + rate to the power of number of periods.

So, the expression would be something like this (where you replace the x with a link to an expression effect slider):

``````PV = x;
R = x;
N = x;
poower = Math.pow(1+R,N);
PV*poooower``````

I don't have AE open to test it, but I don't think I'm too far off.

TOPICS
Expressions, Scripting

Views

128

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

## Future Value calculation/expression in After Effects

New Here ,
Sep 16, 2020

Copied

Hi guys,

Excel has a function called Future Value, it looks like this:

Future Value (rate, nper, pmt, [pv], [type])

 rate - The interest rate per period. nper - The total number of payment periods. pmt - The payment made each period. Must be entered as a negative number. pv - The present value of future payments. If omitted, assumed to be zero. Must be entered as a negative number. type - When payments are due. 0 = end of period, 1 = beginning of period. Default is 0.

I'm looking for a way to replicate this calculation within after effects in order to see a realtime calculation as I animate.

Any help greatly appreciated,

Marc

You would need to use the actual formula for future value.

Make variables for each thing and then pop them together into a formula. Your formula seems a little different than the ones I found by Googling, but you can probably find one and build your expression pretty easily.

The one I found was FV = PV (1 + r)n

Future Value was present value times 1 + rate to the power of number of periods.

So, the expression would be something like this (where you replace the x with a link to an expression effect slider):

``````PV = x;
R = x;
N = x;
poower = Math.pow(1+R,N);
PV*poooower``````

I don't have AE open to test it, but I don't think I'm too far off.

TOPICS
Expressions, Scripting

Views

129

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
10 Replies 10
Sep 16, 2020

Copied

You would need to use the actual formula for future value.

Make variables for each thing and then pop them together into a formula. Your formula seems a little different than the ones I found by Googling, but you can probably find one and build your expression pretty easily.

The one I found was FV = PV (1 + r)n

Future Value was present value times 1 + rate to the power of number of periods.

So, the expression would be something like this (where you replace the x with a link to an expression effect slider):

``````PV = x;
R = x;
N = x;
poower = Math.pow(1+R,N);
PV*poooower``````

I don't have AE open to test it, but I don't think I'm too far off.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
New Here ,
Sep 16, 2020

Copied

Thanks both,

To add context, I’m looking to build an animation of a mobile application that, in real time, shows the expected value of an investment.

There are three inputs, two are financial;

1. A monthly contribution (in units of £10)
2. An optional, one off, upfront lump sum (in units of £100)

Then there are a number of scenarios; each link a period of time with their own annual interest rate.

E.g:

1 year = 1%
2 years = 1.5%
Etc.

In the app, as the user manipulates any of the inputs, the expected outcome updates in real time. The user manipulates the inputs via ‘sliders’ therefore I’d like the expected outcome to update whenever the units are updated.

As an example:

User selects a scenario with an annual interest rate of 1.5%, for 2 years with a monthly contribution of £100.

The animation should show the financial slider starting at £0 working its way up to £100 in £10 intervals, at each interval the expected outcome should update. (This process would repeat if there was an upfront lump sum to consider).

The expected outcome should be able to display up to 8 figures (i.e tens of millions), to 2 decimal places (eg £12,345,678.90).

I hope that provides some clarity, happy to provide further information. I appreciate your help with this.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
Most Valuable Participant ,
Sep 16, 2020

Copied

You will need to be more specific about what you are actually trying to extrapolate and to what properties you want to apply the expression. Calculating fixed interest rates as Szalam provided the pseudo-code for is different from other stuff, including variable interest rates as per the Excel formula. That and from a mere technical standpoint you may actually need extra code to get nice values that AE actualyl can display. Especially with exponential stuff it's easy enough to exhaust AE's internal integer limit and then nothing will work anymore and the expression be disabled. So for all intents and purposes, it might be good if you actually provided a more detailed explanation rather than just asking how to translate a formula from another program.

Mylenium

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
New Here ,
Sep 16, 2020

Copied

Thanks both,

To add context, I’m looking to build an animation of a mobile application that, in real time, shows the expected value of an investment.

There are three inputs, two are financial;

1. A monthly contribution (in units of £10)
2. An optional, one off, upfront lump sum (in units of £100)

Then there are a number of scenarios; each link a period of time with their own annual interest rate.

E.g:

1 year = 1%
2 years = 1.5%
Etc.

In the app, as the user manipulates any of the inputs, the expected outcome updates in real time. The user manipulates the inputs via ‘sliders’ therefore I’d like the expected outcome to update whenever the units are updated.

As an example:

User selects a scenario with an annual interest rate of 1.5%, for 2 years with a monthly contribution of £100.

The animation should show the financial slider starting at £0 working its way up to £100 in £10 intervals, at each interval the expected outcome should update. (This process would repeat if there was an upfront lump sum to consider).

The expected outcome should be able to display up to 8 figures (i.e tens of millions), to 2 decimal places (eg £12,345,678.90).

I hope that provides some clarity, happy to provide further information. I appreciate your help with this.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
Guide ,
Sep 16, 2020

Copied

I'm not sure what AE is doing here?

AE is for rendering videos files - do you want to pre-render all possibilites?

*Martin

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 16, 2020 0
New Here ,
Sep 17, 2020

Copied

Okay, apologies if my post is unclear.

I'm creating a video of a financial mobile application. When the user manipulates three inputs, the total will show the potential return. Therefore I need to animate various scenarios to demonstrate this.

In AE I have designed the app and input sliders, and I can separately animate the total to end up at the corret totals, however unless the total is dynamically linked to the inputs (via the correct formula), the total inbetween scenarios/keyframes will be incorrect.

Does that help explain the situation better? Again apologies if not.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 17, 2020 0
Most Valuable Participant ,
Sep 17, 2020

Copied

Slightly pointless to even rig it up, to be honest. You would have to keyframe so many input parameters, animating the bars or whatever directly would be more efficient and take less time. and with variable payment cycles and interest rates it would have to run inside one big hunking loop, anyway, or else the values wouldn't accumulate correctly, with the real kicker being that it would use valueAtTime() a lot and AE having to look up of different values at different times in potentially millions of loops will slow down things to a point where it's just not funny anymore. I would really suggest you stick to Excel, pick a few sample values and only animate those. the effort required to implement this cleanly in AE would only make sense if you'd use it as an actual template e.g. for broadcast graphics, but not for some unimportant UI mockup that likely will change quicker than you can render your dummies.

Mylenium

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 17, 2020 0
New Here ,
Sep 18, 2020

Copied

Just to update to say that after some perseverance I managed to get achieve what I set out to.

Thanks to Szalam for the inspiration and example - using this I was able to find the formula I needed and break this down in after effects into expressions. I now have a fully working app in AE with the average return dynamically updating as I manipulate and keyframe the input sliders, allowing me to create animations of any scenario with just 3 keyframes. Amazing!

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2020 0
Sep 18, 2020

Copied

That's great! I LOVE creating setups like this where you can control so much with just a few sliders.

What gets really cool is that you can put those controls into the EGP and make them Master Properties. Then, you can make duplicates of that comp with different values of the controls, but then easily go back into the comp and change things like color and layout and it ripples through all the copies that have unique values.

Likes

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 18, 2020 1
LATEST
New Here ,
Sep 18, 2020