Function Problems

How to Implement Excel IRR Function in Power Apps Using Power Fx

Natalie TaylorNatalie Taylor Nov 10, 2026 868 views

Question details

The user wants to reproduce Excel's Internal Rate of Return (IRR) calculation in Power Apps using Power Fx.

How to Implement Excel IRR Function in Power Apps Using Power Fx
Product
Excel / Power Apps
Device & OS
not provided
Scenario
Performing financial modeling or cash flow analysis requiring IRR calculations natively within a Power Apps environment.
Observed behavior
Excel does not publish the exact internal IRR algorithm, requiring a custom numerical method implementation in Power Fx to calculate the discount rate that zeroes out the Net Present Value (NPV).
Before you start

Gather your periodic cash flow data and understand that custom Power Fx calculations may yield slightly different results from Excel due to Microsoft's proprietary and undocumented IRR algorithm.

Solution 1Recommended

Implement a Numerical Solver for IRR in Power Fx

Since the exact Excel algorithm is undocumented, use standard numerical methods like Newton-Raphson or Bisection to find the discount rate that makes the Net Present Value (NPV) zero.

IRR is defined as the discount rate 'r' where NPV(r) = SUM(CashFlow_t / (1+r)^t) = 0.

Because Power Fx lacks a native IRR function, you must build a custom formula that iterates through potential rates starting from an initial guess until it reaches a defined tolerance.

1
Define cash flows and initial guess

Set up your cash flow array in Power Apps using a Collection and define an initial guess for the rate, typically 10% (0.1).

2
Create the NPV calculation logic

Write a Power Fx formula using the ForAll or Sum functions to calculate the Net Present Value based on a variable discount rate.

3
Implement the iteration method

Set up a loop or recursive structure to adjust the discount rate using the Newton-Raphson method or bisection until the NPV is sufficiently close to zero.

4
Handle errors and multiple solutions

Add logic to stop the calculation if it doesn't converge within a specific number of iterations (e.g., 20 steps) to prevent performance issues.

Implement a Numerical Solver for IRR in Power Fx
Accuracy differences: Your Power Apps result might differ slightly from Excel's native IRR function because Excel handles edge cases and convergence thresholds using a proprietary method.
Free Microsoft Office alternative

Perform Financial Calculations Easily with WPS Office

Instead of building complex custom solvers in Power Apps, you can perform accurate financial modeling and calculate IRR directly using WPS Spreadsheet. It offers a familiar interface and seamless compatibility with Microsoft Excel formulas for free.

  1. 1. Open WPS Spreadsheet: Launch WPS Office and create a new Spreadsheet document or open your existing financial model.
  2. 2. Use the IRR function: Select a cell and type =IRR(), then select the range of cells containing your cash flows.
  3. 3. Save and export: Save your document in .xlsx format to ensure full compatibility with Microsoft Office users.
Native support for financial functions including IRR, XIRR, and MIRR100% compatibility with Microsoft Excel (.xlsx) formatsLightweight and runs smoothly on Windows, Mac, and LinuxFree and intuitive interface for complex financial modeling
microsoft office alternative - wps office

Frequently Asked Questions

Why does my Power Apps IRR calculation differ from Excel?

Excel uses a proprietary, undocumented algorithm for its IRR function. When recreating it with standard numerical methods like Newton-Raphson in Power Apps, slight variations in convergence criteria and initial guesses can cause minor differences in the final result.

Can I use the native Excel IRR function directly in Power Apps?

Power Fx currently does not have a native IRR function. You either need to build a custom numerical solver within Power Apps or use a Power Automate flow to pass the data to an Excel file, calculate it there, and return the result to your app.

What is the best initial guess for an IRR calculation?

A standard initial guess is 0.1 (or 10%). If your cash flows have multiple sign changes, there could be multiple internal rates of return, so you may need to adjust the guess closer to your expected rate to find the correct solution.