cancel
Showing results for
Did you mean:
Post Patron

## Limit value returned from multiplication

Hi Power Apps Community,
I would like to multiply two numbers together, BUT the value resulted from the multiplication should not exceed a certain amount. For example, I have a variable for the max amount which is 10.

So if I say 2 * 2 = 4, then the value returned should be 4.
However, if I say 4 * 4 = 12 (which exceeds the max of 10), then the value returned should be the max amount of 10.
I would really appreciate any assistance.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Consider this:

If(
Value(TextInput2.Text) * Value(TextInput1.Text) > 10,
10,
Value(TextInput2.Text) * Value(TextInput1.Text)
)

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

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.

2 REPLIES 2
Super User

Consider this:

If(
Value(TextInput2.Text) * Value(TextInput1.Text) > 10,
10,
Value(TextInput2.Text) * Value(TextInput1.Text)
)

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

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.

Dual Super User

Use IF() function:

If (value1*value2 > MaxAllowedValue, MaxAllowedValue, value1*value2)

4*4=12 (what am I missing ?)

Announcements

#### Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,175)