Some organizations give proportional gratuity for a part-year served beyond the last full year (e.g., 6 months or more). To add this:
=IF(F2>=1, (E2*F2*7)/26, 0)
If the employee resigned today and served a notice period, calculate last working day: gratuity calculation formula in excel pakistan