help with nested if statement....

smilesci

New Member
Joined
Jan 18, 2005
Messages
2
Here is my current formula:
=IF(AND(((D16-K16)/K16*100)>-0.5,((D16-K16)/K16*100)<0.5),0,(D16-K16)/K16*100)

I need an additional condition on top of this that states if K16=0, to give me a value of zero in the cell and disregard the rest of the statement. I cannot figure out how to get an addition OR statement added to this formula. Can anyone help?

Thanks!
Meg
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Tazguy37

MrExcel MVP
Joined
May 28, 2004
Messages
4,237
How about this?:
=IF(K16=0,0,IF(AND(((D16-K16)/K16*100)>-0.5,((D16-K16)/K16*100)<0.5),0,(D16-K16)/K16*100))

Hope that helps!
 

Oaktree

MrExcel MVP
Joined
Jun 20, 2002
Messages
8,021
Office Version
  1. 365
Welcome to the board!

Just add IF(K16=0,0, rest of formula) around the formula you posted for:

=IF(K16=0,0,IF(AND(((D16-K16)/K16*100)>-0.5,((D16-K16)/K16*100)<0.5),0,(D16-K16)/K16*100))

Edit: Too slow for Taz
 

IML

MrExcel MVP
Joined
Feb 15, 2002
Messages
1,743
You could shorten this a bit with
=IF(K16,IF(ABS((D16-K16)/K16)<0.05,0,(D16-K16)/K16*100),0)

still playing
=IF(K16,IF(ABS((D16/K16)-1)<0.005,0,((D16/K16)-1)*100),0)
 

Forum statistics

Threads
1,147,677
Messages
5,742,566
Members
423,738
Latest member
AshleyKitsune

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
Top