Nested IF statement for drilling depth and type

birdman_0711

New Member
Joined
May 15, 2013
Messages
1
I am trying to have Excel calculate a drilling depth based on type of drilling chosen (ranges below) and to combine types if required. The first range (HTW) below is easily done with nested if's. However, the second range needs to build on the first (ie: below HQ/NTW would begin at 259) or calculate solo if the first range is null.

I have the first part of the build-up for HQ/NTW 201-400,however, when adding a scenario where drilling type 1 would be null I consistently get a "FALSE". I know it's complicated, but if anyone has any idea it would be appreciated. Here's what I have:

First part:
=IF(AND($F$12="HTW",F$13<400,F$13>200),400-F$13,IF(AND($F$12="HTW",$F$13>400),0,IF(AND($F$12="HTW",$F$13<400),0)))

Want to add null as follows to above formula (NOT WORKING):
IF((AND($F$12="",$F$14="HQ/NTW", F$15<400,F$15>200), F$15-200 IF(AND(F$15<400,F$15>200),F$15-200,IF(F$15>=400,200, IF(F$15<200,0))),0))))



Drilling Type 1 :HTW
Drill Depth (m):201
Drilling Type 2:HQ/NTW
Drill Depth (m):259
HTW: 0-200 m
HTW: 201-350 m
HTW: 351-500 m
HQ/NTW: 0-200 m
HQ/NTW: 201-400

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
1st formula returns FALSE when it gets to the last If condition and it is false - add something where noted in red below:
=IF(AND($F$12="HTW",F$13<400,F$13>200),400-F$13,IF(AND($F$12="HTW",$F$13>400),0,IF(AND($F$12="HTW",$F$13<400),0,"result when false")))

Your 2nd formula also has too many parenthesis at the end: maybe remove the 3 parenthesis highlighted in red:
IF((AND($F$12="",$F$14="HQ/NTW", F$15<400,F$15>200), F$15-200 IF(AND(F$15<400,F$15>200),F$15-200,IF(F$15>=400,200, IF(F$15<200,0))),0))))
 
Upvote 0
Want to add null as follows to above formula (NOT WORKING):
IF((AND($F$12="",$F$14="HQ/NTW", F$15<400,F$15>200), F$15-200 IF(AND(F$15<400,F$15>200),F$15-200,IF(F$15>=400,200, IF(F$15<200,0))),0))))

Does this work:

Code:
=IF(AND($F$12="",$F$14="HQ/NTW",F$15<400,F$15>200),F$15-200,IF(AND(F$15<400,F$15>200),F$15-200,IF(F$15>=400,200,IF(F$15<200,0)))*0)
 
Upvote 0

Forum statistics

Threads
1,215,059
Messages
6,122,918
Members
449,094
Latest member
teemeren

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