Nested If Statements

Nested If Statements

Having a problem creating a nested if statement.  This works:

if((Imported_BPD  >  -1),Imported_BPD,((Feet  *  12  +  Inches  +  Quarter  -  Previous_Production_Inches)  /  ((Date_Time - Previous_Date_Time)  /  (1000  *  3600  *  24))  *  Tank_Factor))

However, I am wanting to add another check to say if the formula is <0, then BPD = 0.  Here is what I have tried but can't get it to work. Formula Field  Both the argument should be same type for 'IF' task. Expecting 'IF' expression found 'BIGINT' expression


if
(

(Imported_BPD  >  -1),Imported_BPD, 

if(

((Feet  *  12  +  Inches  +  Quarter  -  Previous_Production_Inches)  /  ((Date_Time - Previous_Date_Time)  /  (1000  *  3600  *  24))  *  Tank_Factor) < Previous_Production_Inches, 0,  ((Feet  *  12  +  Inches  +  Quarter  -  Previous_Production_Inches)  /  ((Date_Time - Previous_Date_Time)  /  (1000  *  3600  *  24))  *  Tank_Factor)  
)
)


I've also tried to use another formula field (inches per day) but can't seem to get that to work either.

Thanks,
Chris