Forum Discussion
Guruoligist
Sep 14, 2023Copper Contributor
Writing an equation that reduces an argument by "1" until an acceptable value is returned
I’m taking two numbers and multiplying them to compare the product to another set value to determine if the product is less than the value. If the product is greater than the set value, I want to reduce one of the two numbers in the product by 1 until the product is less than the set value. Then I want to use this reduced number in another equation. Any ideas if this is possible? I would appreciate any assistance.
Should all numbers be positive whole numbers? If so:
Let's say one of the factors is in A1 and the other in B1.
The max value for their product is in C1.
The following formula will return an alternative value for B1, if necessary:
=IF(A1*B1>C1, QUOTIENT(C1, A1), B1)
Enter this formula in - for example - D1.