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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Greater than and Less ...
Power Apps
Unanswered

Greater than and Less Than not working - is my formula wrong?

(0) ShareShare
ReportReport
Posted on by 27

Hi,

 

I am fairly new to power apps and have just recently been presented with a solution as to why power apps wasn't recognising my basic mathematical formulas (with ".Value"! Thank you!). From this I think there are other nuances I have not been able to pick up on through reading or videos and was wanting to ask for some help.  

 

I am now trying to incorporate "If" statements using >= and <=.

The formula is meant to associate a value ("3" or "1") with a number equal to or greater than "10" in this case, and reads as follows.

 

"If(Cell2.Value >= "10", "3", "1")" which does not work.

 

The formula "If(Cell2.Value = "10", "3", "1")" works fine, but adding a < or > to it on either side of the "=" shows an error. 

My thinking is that Power Apps stops recognising "10" as a number, but I'm not sure why it would do this or if my guess is completely off base. After testing I have found that using < or > is something power apps doesn't like at all despite my reading FAQ's and watching videos to the contrary.

 

The end goal is to embed multiple "If" statements to associate a large quantity of numbers with a specific value ranging from 0 - 3. As an example, this formula works in excel perfectly:

 

"=IFS(C2>=131,3, C2<=40,3, C2<=50,1, C2>=111,2, C2>=91,1, C2>=51,0)"

 

and i should be able to recreate it in power apps using just "If" instead of IFS and "Cell2.Value" instead of "C2".

 

I have attached a PDF with my formulas in the app and the results in power apps which I hope will help show better than I might be explaining.

 

Thank you for any help or advice you can give,

 

 

Categories:
I have the same question (0)
  • DownForce Profile Picture
    152 on at

    Set the Format property of Cell2 to Number (as long as you intend to only use it with numbers) and then remove the quotes from your formula.

    If(Cell2.Value >= 10, 3, 1)

     

     

  • DownForce Profile Picture
    152 on at

    Sorry...forgot the Value function

    If(Value(Cell2.Value) >= 10, 3, 1)
  • NCon Profile Picture
    27 on at

    Could I ask how to do this? 

    The box in question is a text box and looking at the properties I can't see anything that allows me to differentiate between it being a Number box or otherwise. Even in the advanced settings it doesn't look like I can alter that...I'm finding a lot of things that should be common in power apps are for some reason absent or hard to find (it could just be me!)

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @NCon

    Consider using the Switch() function instead of If(). You might also consider a slider control instead of a textbox. 

  • NCon Profile Picture
    27 on at

    Thank you! That's likely to be much for friendly for a user as well, 

    I'll give it a try 

     

    Thanks again

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @DownForce

    IMHO, textboxes are designed for text and sliders for numbers. You can make them each do the opposite but it takes a little effort to do it. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @DownForce

    If it answered you question, please mark it as solved so others can find it. 

  • NCon Profile Picture
    27 on at

    Thank you, 

     

    I haven't had chance to test it yet as other projects are taking precedent. 

    Despite that, this doesn't quite answer my question as the "Less than/Greater than and Equal to" functions still aren't working as PowerApps suggests it should. 

     

    Really appreciate the alternatives to text boxes though,

    With thanks, 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard