web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use a formula IFERROR ...
Power Apps
Answered

Use a formula IFERROR into field

(0) ShareShare
ReportReport
Posted on by 485

Hello Community,

 

I have the next Spreadsheet with the next formula:

=IFERROR((1/(A2*B2))*C2,0)

2022-09-07 14_40_17-Book4 - Excel.png

2022-09-07 14_42_11-Book4 - Excel.png

How can I use the above formula into Power Apps field? thanks everyone.

Kind regards.

Categories:
I have the same question (0)
  • Verified answer
    EddieE Profile Picture
    4,650 Moderator on at

    @esjimenezp 

    The math is that if A2 or B2 = 0 then there will we an error, so just check if for this condition, ie

     

    If(
     lbs/gal = 0 || N = 0,
     // then, your error condition goes here
     0,
     // else, your formula here
     ( 1 / lbs/gal * N ) * Cost
    );
    
    // if you add three TextInput fields to add the 3 values, add this code to a label will demo the above
    
    If(
     Value(lbs_gal.Text) = 0 || Value(N.Text) = 0,
     // then, your error condition goes here
     0,
     // else, your formula here
     ( 1 / Value(lbs_gal.Text) * Value(N.Text) ) * Value(Cost.Text)
    )
    

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @esjimenezp 

    Assuming you would have textinput controls for A2, B2 and C2, then your formula would be:

    IfError((1 / (Value(A2input.Text) * Value(B2input.Text)) ) * Value(C2input.Text), 0)

     

    I hope this is helpful for you.

  • esjimenezp Profile Picture
    485 on at

    thanks for your messages, I used both formulas from @EddieE  and @RandyHayes but I don't understand why the values are different in Power Apps.

    This is the Excel file

    esjimenezp_0-1662590039171.png

    and this is from Power Apps

    esjimenezp_1-1662590095481.png

    There are missing something that I cannot see it? thanks

    Kind regards👋

  • EddieE Profile Picture
    4,650 Moderator on at

    @esjimenezp 

    You haven't copied @RandyHayes formula correctly, you are missing a set of brackets here

    (Value(A2input.Text) * Value(B2input.Text))

     

    My original formula was also missing those brackets

  • esjimenezp Profile Picture
    485 on at

    Got it, now I have the next message, the formula was closed 😥

    2022-09-08 09_09_48-Power Apps and 6 more pages - Work - Microsoft​ Edge.png

    Kind regards 👋

  • esjimenezp Profile Picture
    485 on at

    My mistake I forgot a close bracket 🤣 and the both formulas works well thanks @RandyHayes  and @EddieE  I really appreciate your help 👋🙏

     

    IfError((1 / (Value(txt_LbsPerGallon.Text) * Value(txt_N.Text)) ) * Value(txt_CostofProductLB.Text), 0)

    Kind regards 👋

  • esjimenezp Profile Picture
    485 on at

    One more question, why the value is not showing after added this format into the formula?

    "#0.00"

    IfError((1/(Value(txt_LbsPerGallon.Text)*Value(txt_N.Text)))*Value(txt_CostofProductLB.Text),0, "#0.00")

    I just only need to show two digits 

     

    Kind regards 👋

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @esjimenezp 

    Your formula is not syntactically correct (parens out of order) and missing the Text function.  

     

    Should be:

    Text(
     IfError(
     (1 / (Value(txt_LbsPerGallon.Text) * Value(txt_N.Text)) ) * 
     Value(txt_CostofProductLB.Text),
     0
     ), 
     "#0.00"
    )

    I expanded it out just to highlight the parens.

  • esjimenezp Profile Picture
    485 on at

    I was thinking that I needed to add the Text, but I don't remember in which order to added, thanks again @RandyHayes  for all your support.

     

    Kind regards 👋

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @esjimenezp 

    No problem at all!! 😁

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard