#1




Formula calculation
I have a formula(below) that does a markup for charges. I am using senario manager to add different %increases which works fine., But when I try to decrease a % by using a negative number (25%) the % is changed correctly but the math part increses the cost rather than decreasing the cost. IF($D862<=50,($D862*J$2),IF(AND($D862>50,$D862<=15 0),($D862*K$2),IF(AND($D862>=151,$D862<=700),($D86 2*L$2),IF(AND($D862>=701,$D862<=10000),($D862*M$2) ,IF(AND($D862>=1001,$D862<=2000),($D862*N$2),IF(AN D($D862>=2001,$D862<=3000)*($D862*O$2),IF(AND($D86 2>=3001),$D862*P$2))))))) Can anyone tell me why this is happening? and How to fix this? Thanks 
#2




Does it still happen using this alternative ?
=$D862*lookup($d862,{0,50,150,700,1000,2000,3000}, {J$2:P$2}) Maybe post a sample sheet with some of your data showing the problem? 
#3




Thanks for the reply .... I am not well versed with the lookup function. I am attaching a sample worksheet that shows the formulas I am using. The yellow fields are the base values and the blue fields are the adjusted values that are derived from senario manager. Teh range fields are where senario manager makes the changes then the blue fields recalculate and thus the new charges appear.

#4




Could you please add an example of what is going wrong in your sheet?

#5




Quote:
=vlookup( < the formula which we will write in D1 =vlookup(The reference cell that the vlookup looks for in this example we will say A1 =vlookup(A1,Now you need to tell the formula what table to look in we will say b1:c12 in cell B1 type 1 B2 2 B3 3 etc., then in cell C1 type Jan then in C2 type Feb, C3 Mar etc. =vlookup(A1,B1:C12 Now you tell the formula what column of the table to look in b1:c12 only has 2 columns but we want to look into the 2nd one so we would write 2 =vlookup(A1,B1:C12,2 Last part do you want the formula to find an exact match only or get something closest to it. 0 is an exact match and 1 is find the next closest. So it you put in 1.7 in A1 the vlookup will give you the value of 2 which will say Feb in our example. =vlookup(A1,B1:C12,2,0) There it is let me know if you have any questions or if you want me to try and correct your formula to Vlookup. Thanks 
#6




I am willing to learn the lookup function, but this is a time sensative project. If you go to senario and choose new, then show, you will see that even though the correct percentage is calculated in the 1001 to 2000 range, when the math happens to calculate the new charge instead of a decrease I am getting an increase in charge. If you look at the senario itself I am using a negative value to lower the overall percent markup for that price range.(Look at the highlighted bold red field when you run the senario)
Thanks 
#7




I believe I have found part of the issue ... too many If statements??
Any thoughts? If you can convert the formula to a lookup that would be greatly appreciated. I am a visual learner so seeing it would help. 
#8




Quote:
Anyway you have 7 nested IF's which is the maximum allowed , so, no problem there Also, there is an error in your formula =IF($D137<=50,($D137*G$1),IF(AND($D137>50,$D137<=1 50),($D137*H$1),IF(AND($D137>=151,$D137<=700),($D1 37*I$1),IF(AND($D137>=701,$D137<=10000),($D137*J$1),IF(AND($D137>=1001,$D137<=2000),($D1 37*K$1),IF(AND($D137>=2001,$D137<=3000)*($D137*L$1 ),IF(AND($D137>=3001),$D137*M$1))))))) I think the value in red should be 1000 not 10000 ? 
#9




Thanks for pointing out the error!!!! Dumb mistake that makes a big difference ... I will check this out to see if it solves my issues. More later

Thread Tools  
Display Modes  

Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Calculation within Cells  manich1  Excel  2  12072011 02:59 PM 
Excel Calculation Problem  UnholySmoke  Excel  2  09142011 08:15 AM 
Help with 'hours worked' calculation...  Snvlsfoal  Excel  1  08112011 05:54 AM 
Excel 2010 formula rounds  arithmetic average calculation  YooNaa Kim  Excel  1  06072011 08:50 PM 
Mail Merge Calculation Error  Lsbutler2000  Mail Merge  1  06222007 06:33 AM 