Skip to main content

Notifications

Community site session details

Community site session details

Session Id : iIbatZp7SgiWX/3Fb8LNar
Power Apps - Power Query
Answered

Derive Sigma Value

Like (1) ShareShare
ReportReport
Posted on 17 May 2025 14:32:19 by 260
Hi,
 
I need formula in PowerApps, which calculates Inverse of standard normal cumulative distribution, given a probability.
In Excel there is a formula NORMSINV, but nothing of this type in PowerApps.
 
tried using - 
    -Sqrt(-2 * Ln(p)) * (2.515517 0.802853 * Sqrt(-2 * Ln(p)) 0.010328 * (-2 * Ln(p))) / (
        1 1.432788 * Sqrt(-2 * Ln(p)) 0.189269 * (-2 * Ln(p)) 0.001308 * (-2 * Ln(p))^(3/2))
 
where p is the probability value, but the output does not match with the Excel output.
Please help. An Excel file is attached for reference.
 
Regards
Categories:
  • Verified answer
    stampcoin Profile Picture
    2,553 on 17 May 2025 at 19:08:54
    Derive Sigma Value
    @Sam70 Hi,
    You can try this: 
    this should be from  Peter J. Acklam’s algorithm.
    /* Put this in, say, the Text property of a Label (or wherever you need it).
       Replace with your probability value (0<p<1).
    
    With(
        {
            p: ProbabilityValue, //you can pass for example value from TextInput
            p_low: 0.02425,              /* split-points */
            p_high: 0.97575,
    
            /* coefficients for central region */
            a1: -3.969683028665376E+01,  a2:  2.209460984245205E+02,
            a3: -2.759285104469687E+02,  a4:  1.383577518672690E+02,
            a5: -3.066479806614716E+01,  a6:  2.506628277459239E+00,
            b1: -5.447609879822406E+01,  b2:  1.615858368580409E+02,
            b3: -1.556989798598866E+02,  b4:  6.680131188771972E+01,
            b5: -1.328068155288572E+01,
    
            /* coefficients for tails */
            c1: -7.784894002430293E-03, c2: -3.223964580411365E-01,
            c3: -2.400758277161838E+00, c4: -2.549732539343734E+00,
            c5:  4.374664141464968E+00, c6:  2.938163982698783E+00,
            d1:  7.784695709041462E-03, d2:  3.224671290700398E-01,
            d3:  2.445134137142996E+00, d4:  3.754408661907416E+00
        },
        /* guard against p=0 or 1 */
        If(
            p <= 0,
            -1e10,
            If(
                p >= 1,
                1e10,
    
                /* now the 3 regions */
                If(
                    p < p_low,
                    /* lower tail */
                    With(
                        { q: Sqrt(-2 * Ln(p)) },
                        -(
                            (((( (c1 * q + c2) * q + c3) * q + c4) * q + c5) * q + c6)
                            /
                            (((( (d1 * q + d2) * q + d3) * q + d4) * q + 1))
                        )
                    ),
    
                    If(
                        p <= p_high,
                        /* central region */
                        With(
                            { q: p - 0.5, r: (p - 0.5) * (p - 0.5) },
                            (
                                (((( (a1 * r + a2) * r + a3) * r + a4) * r + a5) * r + a6)
                                * q
                            )
                            /
                            (
                                (((( (b1 * r + b2) * r + b3) * r + b4) * r + b5) * r + 1)
                            )
                        ),
    
                        /* upper tail */
                        With(
                            { q: Sqrt(-2 * Ln(1 - p)) },
                            (
                                (((( (c1 * q + c2) * q + c3) * q + c4) * q + c5) * q + c6)
                                /
                                (((( (d1 * q + d2) * q + d3) * q + d4) * q + 1))
                            )
                        )
                    )
                )
            )
        )
    )
    
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1

Featured topics

Loading started