I am currently working on Payroll that would calculate Housing Allowance, transport and others.. but I have problem with building UDF for Tax where the following condition will apply Between 50000 to 74999 should have tax of 10% of basic salary, Between 75,000 to 89,999 should be taxed 20% of Basic salary, between basic salary of 90,000 to 10,000 should be taxed 22% * basic salary ---- I want to define a Function which will be =Tax() to calculate using the parameters above. Please help I am new to VBA. I have defined functions for Housing as Function Housing(a), Housing = a* 34/100, End Function.... so also for transport and other - but the Tax will involve logical If and I don't know what to do next... thanks Please I need answer urgently. thanks and God bless u.