IF statment with mutiple "value if true" (iterative)

andrews25

New Member
Joined
Apr 13, 2018
Messages
1
I have a cell where I am trying to determine a multiplier from 0 to 1 in column A to then be used to scale a value in column B that produces another value in column C. However if column C is greater than zero the multiplier must be reduced until column C is zero (i.e if column C is zero I want the multiplier to be 1, if it is greater than zero I want the multiplier to be as large as possible to produce a zero in column C). I have a poor attempt at this with the following if statement in column A:

=IF(C1>0,0.95,IF(C1>0,0.9,IF(C1>0,0.85,IF(C1>0,0.8,IF(C1>0,0.75,IF(C1>0,0.7,IF(C1>0,0.65,IF(C1>0,0.6,IF(C1>0,0.55,IF(C1>0,0.5,IF(C1>0,0.45,IF(C1>0,0.4,IF(C1>0,0.35,IF(C1>0,0.3,IF(C1>0,0.25,IF(C1>0,0.2,IF(C1>0,0.15,IF(C1>0,0.1,IF(C1>0,0.05,IF(C1>0,0,1))))))))))))))))))))

However this stops after the first IF and leaves me with 0.95 and does not continue to reduce the multiplier if the value is still greater than zero. I guess the objective I am trying to accomplish is IF C1>0 then 0.95, IF C1 is still>0, 0.9 and so on. If there is a better way to accomplish this I'd love the help.
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
What you are trying to do is impossible with an If statement. It is NOT an interative statement, the formula takes the value of C1 just once and then tries to work out the whole statement. Which it suceeds at doing because C1 is greater than zero so the result is 0.95, excel doesn't bother to calculate the rest of the equation at all. If you do write the formula in such away that it appears to be iterative, you will just get a"circular Reference" error showing up, so it still won't do it.
there are two ways you can do what you want
1: Use the solver addin
2: Write a vBA routine to iterate to the solution you want.
 
Upvote 0
Hi,

I'm not understanding what you're trying to do, any non-zero positive number, no matter how many times you multiply it by any other non-zero positive number, will never make the first number result in zero, like as shown in C6 and D6 below, so maybe formula in D2 is what you're looking for?


Excel 2010
CD
1Multiplier
201
3-0.051
40.0010
5
60.10.001
Sheet12
Cell Formulas
RangeFormula
D2=IF(C2<=0,1,0)
D6=C6*0.01
 
Upvote 0
Welcome to the MrExcel board!

Any chance we could see a small set of sample data and the expected results with any further clarification that you could give?
My signature block below has a link for good ways to provide sample data that we can test with.
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,867
Members
449,053
Latest member
Mesh

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

Which adblocker are you using?

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
Back
Top