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

Can you sort left to right?
To sort left-to-right, use the Sort dialog box. Click Options. Choose "Sort left to right"

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,105
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,181,993
Messages
5,933,154
Members
436,881
Latest member
CMScons

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