Menu

Post image 1
Post image 2
1 / 2
0

Demystifying ROI and CAGR with five JavaScript snippets

DEV Community·levent çelik·about 1 month ago
#AqotNARN
Reading 0:00
15s threshold

Two acronyms cause more confusion in product analytics meetings than any others I know: ROI and CAGR. They sound interchangeable in slides, they look interchangeable in spreadsheets, and they are absolutely not the same thing. After watching one too many "the experiment had 200% ROI" claims fall apart on a closer read, I sat down and wrote out the actual formulas in code. Here they are. ROI: the simple one Return on Investment is just net gain divided by cost. function roi ({ gain , cost }) { return (( gain - cost ) / cost ) * 100 ; } roi ({ gain : 1500 , cost : 1000 }); // 50 Enter fullscreen mode Exit fullscreen mode A $1,000 investment that returns $1,500 has a 50% ROI. Done. The trap people fall into is forgetting that this number is timeless. A 50% ROI over 1 year is amazing. A 50% ROI over 30 years is dismal (it loses to inflation by a wide margin). ROI alone tells you nothing about how fast.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More