Help with Embedded If statement

cdnqte

Board Regular
Joined
Jul 14, 2004
Messages
132
I am hoping someone can help!

I have a formula that in some cases is returning a #div/0! error.

in it's simplest form in know how to enter the formula to make that a 0. So if my formula were nextbillamount/nextbilldays I would enter if(n(nextbilldays),nextbillamount/nextbildays,0) and I get 0 instead of the error on all rows where nextbildays = 0.

However, my cell is a little more complicated than that and I am struggling with the embedded ifs.... here is how it looks right now...


=IF([@[Billing Adjustment Needed?]]="Adv",[@[Next Bill Amount]]/[@[Next Bill Days Adv]],[@[Next Bill Amount]]/[@[Next Bill Days Arr]])

I need to get the additional if statement in there to eliminate the error when the next bill days adv field is 0.

Can someone assist? Embedded ifs mess me up all the time!

Thanks in advance!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
you could use the =iferror function... =iferror(formula, value you want if you receive and error).

=iferror(IF([@[Billing Adjustment Needed?]]="Adv",[@[Next Bill Amount]]/[@[Next Bill Days Adv]],[@[Next Bill Amount]]/[@[Next Bill Days Arr]]),0)
 
Upvote 0
you could use the =iferror function... =iferror(formula, value you want if you receive and error).

=iferror(IF([@[Billing Adjustment Needed?]]="Adv",[@[Next Bill Amount]]/[@[Next Bill Days Adv]],[@[Next Bill Amount]]/[@[Next Bill Days Arr]]),0)

.... this would give you a 0 value.
 
Upvote 0
or... here is the nested IF...

=(IF([@[Next Bill Days Adv]]=0,0,IF([@[Billing Adjustment Needed?]]="Adv" [@[ (IF([@[Billing Adjustment Needed?]]="Adv",[@[Next Bill Amount]]/[@[Next Bill Days Adv]],[@[Next Bill Amount]]/[@[Next Bill Days Arr]]))
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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