1"use strict";(self.webpackChunktoolser_net=self.webpackChunktoolser_net||[]).push([[1601],{1776:(e,s,a)=>{a.r(s),a.d(s,{assets:()=>y,contentTitle:()=>g,default:()=>v,frontMatter:()=>j,metadata:()=>t,toc:()=>N});const t=JSON.parse('{"type":"mdx","permalink":"/cagr-calculator","source":"@site/src/pages/cagr-calculator.mdx","title":"CAGR Calculator","description":"Only need to fill in the \\"Initial Investment Input\\", \\"Final Maturity Value\\", and \\"Length of Time in Years\\" to calculate CAGR and draw charts and provide downloads","frontMatter":{"title":"CAGR Calculator","description":"Only need to fill in the \\"Initial Investment Input\\", \\"Final Maturity Value\\", and \\"Length of Time in Years\\" to calculate CAGR and draw charts and provide downloads","hide_table_of_contents":true},"unlisted":false}');var n=a(4848),i=a(8453),l=a(5771),r=a(6540),m=a(539),c=a(1489),d=a(3581),h=a(7156),o=a(7512),p=a(7859),u=a(686);function x(){const[e,s]=(0,r.useState)(""),[a,t]=(0,r.useState)(""),[i,l]=(0,r.useState)(""),[x,j]=(0,r.useState)([]),[g,y]=(0,r.useState)([]),[N,f]=(0,r.useState)([]),[v,z]=(0,r.useState)(!1),[A,C]=(0,r.useState)(!1),[b,R]=(0,r.useState)(!1),[w,I]=(0,r.useState)(""),[T,G]=(0,r.useState)(!1),[F,V]=(0,r.useState)(""),[S,M]=(0,r.useState)("hidden"),[k,P]=(0,r.useState)(""),W=s=>{let a=[],t=[],n=[],l=parseInt(e),r=parseFloat(i),m=l,c=l;a.push(0),t.push(l),n.push(c),m=l;for(let e=1;e<=r;e++)c*=1+s/100,a.push(e),t.push(m),n.push(Math.round(c));j(a),y(t),f(n)};const _={title:{text:(0,m.T)({message:"Calculation Results"})},tooltip:{trigger:"axis"},legend:{data:[(0,m.T)({message:"Compound Interest"}),(0,m.T)({message:"Initial Investment"})]},grid:{left:"3%",right:"3%",bottom:"3%",containLabel:!0},toolbox:{feature:{saveAsImage:{}}},xAxis:{type:"category",boundaryGap:!1,data:x},yAxis:{type:"value"},series:[{name:(0,m.T)({message:"Compound Interest"}),type:"line",smooth:!0,data:N},{name:(0,m.T)({message:"Initial Investment"}),type:"line",smooth:!0,data:g}]};let L=[],O=[];return"hidden"===S?(L=[],O=[]):(L=(0,n.jsx)(u.A,{option:_}),O=(0,n.jsx)("div",{style:{marginTop:10},children:(0,n.jsx)(h.A,{style:{padding:20,backgroundColor:"#c4e0e6"},children:(0,n.jsxs)(p.A,{children:["CAGR\uff1a ",k]})})})),(0,n.jsx)("div",{children:(0,n.jsxs)(c.Ay,{container:!0,spacing:2,children:[(0,n.jsx)(c.Ay,{item:!0,xs:12,md:4,style:{paddingTop:30},children:(0,n.jsxs)(h.A,{style:{padding:15},children:[(0,n.jsx)("h2",{children:(0,n.jsx)(m.A,{children:"Calculate CAGR"})}),(0,n.jsx)(d.A,{fullWidth:!0,id:"initialInvestment",label:(0,m.T)({message:"Initial Investment Input"}),variant:"outlined",value:e,type:"number",onChange:e=>{s(e.target.value)},style:{paddingBottom:15},error:v,helperText:w}),(0,n.jsx)(d.A,{fullWidth:!0,id:"finalMaturityValue",label:(0,m.T)({message:"Final Maturity Value"}),variant:"outlined",value:a,type:"number",onChange:e=>{t(e.target.value)},style:{paddingBottom:15},error:A,helperText:T}),(0,n.jsx)(d.A,{fullWidth:!0,id:"years",label:(0,m.T)({message:"Length of Time in Years"}),variant:"outlined",value:i,type:"number",onChange:e=>{l(e.target.value)},style:{paddingBottom:15},error:b,helperText:F}),(0,n.jsx)("div",{style:{marginTop:10,textAlign:"center"},children:(0,n.jsx)(o.A,{variant:"contained",onClick:()=>{if(z(!1),C(!1),R(!1),I(""),G(""),V(""),M("hidden"),j([]),f([]),function(){let s=!1,t=parseInt(e),n=parseInt(a),l=parseFloat(i);(isNaN(t)||t<1||t>1e7)&&(z(!0),I("must be between 1 and 10000000"),s=!0);(isNaN(n)||n<1||n>1e7)&&(C(!0),G("must be between 1 and 10000000"),s=!0);(isNaN(l)||l<1||l>100)&&(R(!0),V("must be between 1 and 100"),s=!0);return s}())return;let s=parseInt(e),t=parseInt(a),n=parseFloat(i),l=Math.pow(t/s,1/n)-1;P((100*l).toFixed(2)+"%"),W(100*parseFloat(l)),M("visible")},children:(0,n.jsx)(m.A,{children:"Calculate"})})})]})}),(0,n.jsx)(c.Ay,{item:!0,xs:12,md:8,style:{textAlign:"center",paddingTop:30},children:(0,n.jsxs)(h.A,{style:{padding:15,visibility:S},children:[L,O]})})]})})}const j={title:"CAGR Calculator",description:'Only need to fill in the "Initial Investment Input", "Final Maturity Value", and "Length of Time in Years" to calculate CAGR and draw charts and provide downloads',hide_table_of_contents:!0},g=void 0,y={},N=[{value:"What is CAGR",id:"what-is-cagr",level:2},{value:"CAGR Formula",id:"cagr-formula",level:2},{value:"CAGR Annual Return Calculator Usage",id:"cagr-annual-return-calculator-usage",level:2}];function f(e){const s={a:"a",admonition:"admonition",annotation:"annotation",h2:"h2",li:"li",math:"math",mfrac:"mfrac",mi:"mi",mn:"mn",mo:"mo",mrow:"mrow",mstyle:"mstyle",msup:"msup",p:"p",semantics:"semantics",span:"span",ul:"ul",...(0,i.R)(),...e.components};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{style:{marginTop:-20,marginBottom:20},children:[(0,n.jsx)(l.A,{title:"CAGR Calculator"}),(0,n.jsx)(x,{})]}
1),"\n",(0,n.jsx)(s.p,{children:'Only need to fill in the "Initial Investment Input", "Final Maturity Value", and "Length of Time in Years" to calculate CAGR and draw charts and provide downloads'}),"\n",(0,n.jsx)("hr",{}),"\n",(0,n.jsx)(s.h2,{id:"what-is-cagr",children:"What is CAGR"}),"\n",(0,n.jsx)(s.p,{children:'CAGR (Compound Annual Growth Rate), is a type of "annualized rate of return" in financial statements. If you are reading this website\'s blog backtesting article, you should be familiar with CAGR. The calculation is based only on the initial and final values of the investment amount, without considering the intermediate fluctuations. In fact, it is the compound interest in the compound interest table.'}),"\n",(0,n.jsx)(s.p,{children:"ex:"}),"\n",(0,n.jsx)(s.p,{children:"Principal 100, compound interest rate 20%, term is ten years => The final amount is 619."}),"\n",(0,n.jsx)(s.p,{children:"Principal 100, final amount is 619, term is ten years => CAGR is 20%."}),"\n",(0,n.jsx)("br",{}),"\n",(0,n.jsx)(s.h2,{id:"cagr-formula",children:"CAGR Formula"}),"\n",(0,n.jsxs)(s.p,{children:["CAGR\n",(0,n.jsxs)(s.span,{className:"katex",children:[(0,n.jsx)(s.span,{className:"katex-mathml",children:(0,n.jsx)(s.math,{xmlns:"http://www.w3.org/1998/Math/MathML",children:(0,n.jsxs)(s.semantics,{children:[(0,n.jsxs)(s.mrow,{children:[(0,n.jsx)(s.mo,{children:"="}),(0,n.jsxs)(s.mstyle,{mathsize:"1.2em",children:[(0,n.jsxs)(s.msup,{children:[(0,n.jsxs)(s.mrow,{children:[(0,n.jsx)(s.mo,{fence:"true",children:"("}),(0,n.jsxs)(s.mfrac,{children:[(0,n.jsxs)(s.mrow,{children:[(0,n.jsx)(s.mi,{children:"F"}),(0,n.jsx)(s.mi,{children:"V"})]}),(0,n.jsxs)(s.mrow,{children:[(0,n.jsx)(s.mi,{children:"P"}),(0,n.jsx)(s.mi,{children:"V"})]})]}),(0,n.jsx)(s.mo,{fence:"true",children:")"})]}),(0,n.jsxs)(s.mfrac,{children:[(0,n.jsx)(s.mn,{children:"1"}),(0,n.jsx)(s.mi,{children:"n"})]})]}),(0,n.jsxs)(s.mstyle,{mathsize:"1em",children:[(0,n.jsx)(s.mo,{children:"\u2212"}),(0,n.jsx)(s.mn,{children:"1"})]})]})]}),(0,n.jsx)(s.annotation,{encoding:"application/x-tex",children:"= \\large\\left(\\frac{FV}{PV}\\right)^{\\frac{1}{n}} \\normalsize- 1"})]})})}),(0,n.jsxs)(s.span,{className:"katex-html","aria-hidden":"true",children:[(0,n.jsxs)(s.span,{className:"base",children:[(0,n.jsx)(s.span,{className:"strut",style:{height:"0.3669em"}}),(0,n.jsx)(s.span,{className:"mrel",children:"="}),(0,n.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2778em"}})]}),(0,n.jsxs)(s.span,{className:"base",children:[(0,n.jsx)(s.span,{className:"strut",style:{height:"2.2115em",verticalAlign:"-0.59em"}}),(0,n.jsxs)(s.span,{className:"minner sizing reset-size6 size7",children:[(0,n.jsxs)(s.span,{className:"minner",children:[(0,n.jsx)(s.span,{className:"mopen sizing reset-size7 size6 delimcenter",style:{top:"-0.05em"},children:(0,n.jsx)(s.span,{className:"delimsizing size2",children:"("})}),(0,n.jsxs)(s.span,{className:"mord",children:[(0,n.jsx)(s.span,{className:"mopen nulldelimiter sizing reset-size7 size6"}),(0,n.jsx)(s.span,{className:"mfrac",children:(0,n.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(s.span,{className:"vlist-r",children:[(0,n.jsxs)(s.span,{className:"vlist",style:{height:"0.8496em"},children:[(0,n.jsxs)(s.span,{style:{top:"-2.655em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"sizing reset-size7 size4 mtight",children:(0,n.jsxs)(s.span,{className:"mord mtight",children:[(0,n.jsx)(s.span,{className:"mord mathnormal mtight",style:{marginRight:"0.13889em"},children:"P"}),(0,n.jsx)(s.span,{className:"mord mathnormal mtight",style:{marginRight:"0.22222em"},children:"V"})]})})]}),(0,n.jsxs)(s.span,{style:{top:"-3.23em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"frac-line",style:{borderBottomWidth:"0.04em"}})]}),(0,n.jsxs)(s.span,{style:{top:"-3.394em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"sizing reset-size7 size4 mtight",children:(0,n.jsxs)(s.span,{className:"mord mtight",children:[(0,n.jsx)(s.span,{className:"mord mathnormal mtight",style:{marginRight:"0.13889em"},children:"F"}),(0,n.jsx)(s.span,{className:"mord mathnormal mtight",style:{marginRight:"0.22222em"},children:"V"})]})})]})]}),(0,n.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(s.span,{className:"vlist-r",children:(0,n.jsx)(s.span,{className:"vlist",style:{height:"0.345em"},children:(0,n.jsx)(s.span,{})})})]})}),(0,n.jsx)(s.span,{className:"mclose nulldelimiter sizing reset-size7 size6"})]}),(0,n.jsx)(s.span,{className:"mclose sizing reset-size7 size6 delimcenter",style:{to
1p:"-0.05em"},children:(0,n.jsx)(s.span,{className:"delimsizing size2",children:")"})})]}),(0,n.jsx)(s.span,{className:"msupsub",children:(0,n.jsx)(s.span,{className:"vlist-t",children:(0,n.jsx)(s.span,{className:"vlist-r",children:(0,n.jsx)(s.span,{className:"vlist",style:{height:"1.3512em"},children:(0,n.jsxs)(s.span,{style:{top:"-3.773em",marginRight:"0.0417em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"sizing reset-size7 size4 mtight",children:(0,n.jsx)(s.span,{className:"mord mtight",children:(0,n.jsxs)(s.span,{className:"mord mtight",children:[(0,n.jsx)(s.span,{className:"mopen nulldelimiter sizing reset-size4 size6"}),(0,n.jsx)(s.span,{className:"mfrac",children:(0,n.jsxs)(s.span,{className:"vlist-t vlist-t2",children:[(0,n.jsxs)(s.span,{className:"vlist-r",children:[(0,n.jsxs)(s.span,{className:"vlist",style:{height:"0.8673em"},children:[(0,n.jsxs)(s.span,{style:{top:"-2.656em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"sizing reset-size4 size2 mtight",children:(0,n.jsx)(s.span,{className:"mord mtight",children:(0,n.jsx)(s.span,{className:"mord mathnormal mtight",children:"n"})})})]}),(0,n.jsxs)(s.span,{style:{top:"-3.2255em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"frac-line mtight",style:{borderBottomWidth:"0.049em"}})]}),(0,n.jsxs)(s.span,{style:{top:"-3.384em"},children:[(0,n.jsx)(s.span,{className:"pstrut",style:{height:"3em"}}),(0,n.jsx)(s.span,{className:"sizing reset-size4 size2 mtight",children:(0,n.jsx)(s.span,{className:"mord mtight",children:(0,n.jsx)(s.span,{className:"mord mtight",children:"1"})})})]})]}),(0,n.jsx)(s.span,{className:"vlist-s",children:"\u200b"})]}),(0,n.jsx)(s.span,{className:"vlist-r",children:(0,n.jsx)(s.span,{className:"vlist",style:{height:"0.344em"},children:(0,n.jsx)(s.span,{})})})]})}),(0,n.jsx)(s.span,{className:"mclose nulldelimiter sizing reset-size4 size6"})]})})})]})})})})})]}),(0,n.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}}),(0,n.jsx)(s.span,{className:"mbin sizing reset-size6 size6",children:"\u2212"}),(0,n.jsx)(s.span,{className:"mspace",style:{marginRight:"0.2222em"}})]}),(0,n.jsxs)(s.span,{className:"base",children:[(0,n.jsx)(s.span,{className:"strut",style:{height:"0.6444em"}}),(0,n.jsx)(s.span,{className:"mord sizing reset-size6 size6",children:"1"})]})]})]})]}),"\n",(0,n.jsx)(s.p,{children:"FV (Future Value): The final amount."}),"\n",(0,n.jsx)(s.p,{children:"PV (Present Value): The principal."}),"\n",(0,n.jsx)(s.p,{children:"n: The number of periods."}),"\n",(0,n.jsx)("br",{}),"\n",(0,n.jsx)(s.h2,{id:"cagr-annual-return-calculator-usage",children:"CAGR Annual Return Calculator Usage"}),"\n",(0,n.jsx)(s.p,{children:'Only fill in the "Principal", "Final Maturity Amount", and "Term in Years". With compound frequency set to "yearly", you can calculate the CAGR and draw a chart based on the number of periods, and provide a download option.'}),"\n",(0,n.jsx)("br",{}),"\n",(0,n.jsx)(s.admonition,{title:"Other Calculator",type:"note",children:(0,n.jsxs)(s.ul,{children:["\n",(0,n.jsx)(s.li,{children:(0,n.jsx)(s.a,{href:"/compound-interest-calculator",children:"Compound Interest Calculator"})}),"\n"]})})]})}function v(e={}){const{wrapper:s}={...(0,i.R)(),...e.components};return s?(0,n.jsx)(s,{...e,children:(0,n.jsx)(f,{...e})}):f(e)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.