Set formula to calculate 0 when 'D6' is empty

JadonR

Board Regular
Joined
Apr 15, 2009
Messages
154
Office Version
  1. 365
I have the following formula:
Code:
=IF(D5="Fixed Price",0.5,IF(AND((D6*D9)>=0.01,(D6*D9)<=0.99),0,IF(AND((D6*D9)>=1,(D6*D9)<=9.99),0.25,IF(AND((D6*D9)>=10,(D6*D9)<=24.99),0.5,IF(AND((D6*D9)>=25,(D6*D9)<=49.99),0.75,IF(AND((D6*D9)>=50,(D6*D9)<=199.99),1,IF(AND((D6*D9)>=200,(D6*D9)<=499.99),2,IF((D6*D9)>=500,2,0))))))))*IF(G16="Yes",2,1)
I want it to show zero if cell 'D6' is also zero. I tried nesting more IF statements but keep getting errors. Any ideas?
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.
Try

=IF(D5="Fixed Price",0.5*(D6>0),(MATCH(D6*D9,{0,1,10,25,50,200})-1)*0.25)*IF(G16="Yes",2,1)

With a few test figures, does it give the desired results?
 
Upvote 0
Impressive, that really shortened it up. It works perfect until cell 'D6' is at or above 200. Then it shows 1.25 instead of 2.00. Maybe an easy fix?
 
Upvote 0
Oops, I missed that step-up point.

=IF(D5="Fixed Price",0.5*(D6>0),(MATCH(D6*D9,{0,1,10,25,50,200,200,200,200})-1)*0.25)*IF(G16="Yes",2,1)

Fixes that, or as an alternative

=IF(D5="Fixed Price",0.5*(D6>0),LOOKUP(D6*D9,{0,1,10,25,50,200},{0,0.25,0.5,0.75,1,2}))*IF(G16="Yes",2,1)

which I would imagine would be the version that the majority of users would suggest.
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

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