I want to write small code in excel vb editor to calculate gratuity amount.

Rules is if the employee has completed between 1 - 2 years of service he is entitled to 7 days of Basic salary

If the employee has completed between 2 - 4 years of service he is entitled
to 14 days of Basic salary

If the employeed has completed 5 years of service he is entitled to 21 days
of Basic salary

If completed more than 5 years he is entitled to 30 days of Basic salary,But
here the catch is for first 5 years he will get 21 days and balance years will
be calculated in 30 days basic pay