• Resolved shashibiz2books

    (@shashibiz2books)


    Hi i have develop tax calculator with CFF but facing some problem in one condition
    i have formula in excel as follow
    =IF(B5<=5000000,0,IF(B5<=10000000,IF((C8+C10-1237500)>(B5-5000000),C8+C10-1237500-(B5-5000000),0),IF(B5<=20000000,IF((C8+C10-3011250)>(B5-10000000),(C8+C10-3011250)-(B5-10000000),0),IF(B5<=50000000,IF((C8+C10-6598125)>(B5-20000000),(C8+C10-6598125)-(B5-20000000),0),IF(B5>50000000,IF((C8+C10-18421875)>(B5-50000000),(C8+C10-18421875)-(B5-50000000),0))))))

    and CFF form is

    (function(){
    if(fieldname4<5000000)
    return fieldname4*0;
    if(fieldname4 <= 10000000 && fieldname12 + fieldname14 -1237500 > fieldname4 – 5000000)

    return fieldname12+fieldname14-1237500-(fieldname4-5000000);

    if(fieldname4 <= 20000000 && fieldname12 + fieldname14 -3011250 > fieldname4 – 10000000)
    return fieldname12+fieldname14-3011250-(fieldname4-10000000);

    if(fieldname4 <= 50000000 && fieldname12 + fieldname14 -6598125 > fieldname4 – 20000000)

    return fieldname12+fieldname14-6598125-(fieldname4-20000000);

    if(fieldname4 > 50000000&& fieldname12 + fieldname14 -18421875 > fieldname4 – 50000000)

    return fieldname12+fieldname14-18421875-(fieldname4-50000000);

    })();

    some condition is not working properly please help me

Viewing 1 replies (of 1 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @shashibiz2books

    If you have tested your original formula, why you don’t use it in the form? In this case you simply should to remove the equal symbol, and replace the cells’ names by the corresponding fields’ names:

    
    IF(fieldname4<=5000000,0,IF(fieldname4<=10000000,IF((fieldname12+fieldname14-1237500)>(fieldname4-5000000),fieldname12+fieldname14-1237500-(fieldname4-5000000),0),IF(fieldname4<=20000000,IF((fieldname12+fieldname14-3011250)>(fieldname4-10000000),(fieldname12+fieldname14-3011250)-(fieldname4-10000000),0),IF(fieldname4<=50000000,IF((fieldname12+fieldname14-6598125)>(fieldname4-20000000),(fieldname12+fieldname14-6598125)-(fieldname4-20000000),0),IF(fieldname4>50000000,IF((fieldname12+fieldname14-18421875)>(fieldname4-50000000),(fieldname12+fieldname14-18421875)-(fieldname4-50000000),0))))))
    

    Best regards.

Viewing 1 replies (of 1 total)
  • The topic ‘if and else condition’ is closed to new replies.