cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAppsNoob1
Frequent Visitor

Struggling with a formula

Hi all

 

Hoping someone can help me as I've been scratching my head!

I have created a formula but it is not working as expected. This is what I would like to happen.

 

If slider <= 15 then do slider*20.
If slider > 15 then keep slider*20 and any additional add 15.

 

Basically what I want is to move the slider and for any numbers below or matching 15 to be x20 and then if the slider is higher than 15 keep the 15x20 and then add 15 for each additional number.

E.G: 15*20 = 300 so if the number of the slider is 16 the total number should be 315, if the number on the slider is 17 the total should be 330 and so on.
However, I get 225 as its the whole slider now being X by 15.

 

Here is my code
Sum(If(NumberofUserSlider.Value > 15,NumberofUserSlider*15) + If(NumberofUserSlider.Value <= 15,NumberofUserSlider*20)

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rahber
Solution Sage
Solution Sage

Hello can you try this code.

Add a Label and add the following code to its Text Property


If(NumberofUserSlider.Value <= 15, NumberofUserSlider.Value * 20,300 +((NumberofUserSlider.Value-15) *15))

 

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@PowerAppsNoob1 

Here’s my thought on it.  Put this code inside the Text property of a label.

 

 

If(NumberofUserSlider.Value <=15, NumberofUserSlider.Value*20, NumberofUserSlider.Value > 15, NumberofUserSlider.Value*20*15)

 

---

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Rahber
Solution Sage
Solution Sage

Hello can you try this code.

Add a Label and add the following code to its Text Property


If(NumberofUserSlider.Value <= 15, NumberofUserSlider.Value * 20,300 +((NumberofUserSlider.Value-15) *15))

 

 

Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

Thanks,

Rahber

Try

If(NumberofUserSlider.Value > 15,
NumberofUserSlider*15 +
NumberofUserSlider.Value, If(NumberofUserSlider.Value <= 15,NumberofUserSlider*20))

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

PowerAppsNoob1
Frequent Visitor

Thankyou all for your quick reply.
The issue is now resolved 🙂 

 

using the following Sum(If(NumberofUserSlider.Value <= 15, NumberofUserSlider.Value * 20,300 +((NumberofUserSlider.Value-15) *15)))

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,225)