# Stumped

#### dhaderle

##### New Member
Math problem for you all that I'm trying to solve without a bunch of IF statements or lookups.

I have an input cell for widgets. I price 400 widgets at \$32.00 each. For every additional widget the price will be one penny less. So, 401 widgets entered in will yield a price of \$31.99, 402 widgets equal \$31.98, etc, etc....
At 500 widgets, the price decrease changes to two pennies less for every incremental widget. At 600 widgets the price then is fixed at \$29.00 At 400 or less the price is \$32.00/each.

Is there a formula/function able to solve this?

Thanks!

### Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi

Assuming that your widgets go into A2 try

Code:
``=IF(A2>=600,A2*29,IF(A2>=501,12800+(A2-400)*(3200-(A2-400)*2)/100,IF(A2>=401,12800+(A2-400)*(3200-(A2-400))/100,A2*32)))``

Tony

The math is not right. If I put 401 widgets into A2 the new price is not 31.99, instead it is 31.999975 which rounds to 32.00.

Hi

Can you give some examples of numbers of widgets, and expected results. To me 400 widgets should give a total of 12800, and 401 should give 12831.99. Or should 401 widgets have a total of 12827.99???

Tony

dhaderle

I put Tony's formula in B2, which gives me 12827.99
Then put =ROUNDDOWN(B2/A2, 2) in C2.
That gives you your 31.99

Datsmart

You might also try:

=IF(A1<=400,32*A1,IF(A1<=499,A1*(32-(A1-400)/100),IF(A1<=599,A1*(32-2*(A1-500)/100),29*A1)))

with the number of widgets in cell A1. (Sounds like homework I once had).

Try this:

=MAX(29,41-MAX(A2/100,4)-MAX(A2/100,5))

Ronald, an excellent solution, I like it.

Thanks Ronald! Though, I don't quite understand it the formula.

Ronald Moore said:
Try this:

=MAX(29,41-MAX(A2/100,4)-MAX(A2/100,5))

*Applause*

I think we have a winner! Very nice solution!

Replies
10
Views
489
Replies
1
Views
268
Replies
0
Views
1K
Replies
1
Views
515
Replies
5
Views
411

Threads
1,206,754
Messages
6,074,751
Members
446,083
Latest member
kfunt

### We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

### Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

### Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

### Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

### Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back