cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper I
Helper I

if statement with ||

Dear Pros,

 

I am trying to use If, but it is not working properly as I want.

 

When in TEXT INPUT input some currency then LABEL should show the right behind numbers which shown in table below.

0-500,0001
500,001-1,000,0002
1,000,001-5,000,0003
5,000,001-10,000,0004
10,000,001- more5

 

I try : 

If(Value(Scoring.Text) <= 500000 ,1, Value(Scoring.Text) >= 10000001,5,Value(Scoring.Text) > 500000 || Value(Scoring.Text)<= 1000000,2, Value(Scoring.Text) > 1000000 || Value(Scoring.Text) <= 5000000,3,4)

This is not working as I want, please check the codes and help me to fix.

 

BR

Altanzaya

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @altanzaya ,

Try this

Switch(
   Value(Scoring.Text),
    <= 500000,1, 
   (> 500000 && <= 1000000),2,
   (>1000000 && <= 5000000),3,
   (>5000000 && <= 10000000),4,
   5
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Sorry @altanzaya ,

I really thought that would work - I should have tested it - this does

With(
    {vScore: Value(Scoring.Text)},
    If(
        vScore <= 500000,
        1,
        vScore > 500000 && vScore <= 1000000,
        2,
        vScore > 1000000 && vScore <= 5000000,
        3,
        vScore > 5000000 && vScore <= 10000000,
        4,
        5
    )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

7 REPLIES 7
Super User III
Super User III

Hi @altanzaya ,

Try this

Switch(
   Value(Scoring.Text),
    <= 500000,1, 
   (> 500000 && <= 1000000),2,
   (>1000000 && <= 5000000),3,
   (>5000000 && <= 10000000),4,
   5
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Super User II
Super User II

Hi @altanzaya 

The Switch function works better here I think,

Switch(Value(Scoring.Text), <=50000,"1",> 500000 && <= 1000000,"2", >100000 && <=5000000,"3","4")

Dear Drrickryp Super User,

 

Please check the error

 

BR
Altanzaya

Sorry @altanzaya ,

Logical error in mine (now fixed) - I was focusing on syntax instead of mathematical logic)

Dear WarrenBelz

 

It appears same error 😞

 

 

Sorry @altanzaya ,

I really thought that would work - I should have tested it - this does

With(
    {vScore: Value(Scoring.Text)},
    If(
        vScore <= 500000,
        1,
        vScore > 500000 && vScore <= 1000000,
        2,
        vScore > 1000000 && vScore <= 5000000,
        3,
        vScore > 5000000 && vScore <= 10000000,
        4,
        5
    )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Yesssss it is working thank u very much!!!!

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,986)