Jul 12 2022 09:36 PM
hi
this is for calculating annual leave days deserved
if G1>=12 (months) THEN G1*2,5
IF 6 (months)<=G1<12 (months) THEN G1*2
how can i combine in 1 formula, it is working for one condition not for the other.
thanks
Jul 12 2022 09:49 PM - edited Jul 12 2022 09:50 PM
Cannot work out whether you are doing VBA or Excel. Either language requires an AND.
Jul 13 2022 12:55 AM - edited Jul 13 2022 04:01 AM
There should be clear on after completion of 12 months 2.5 days then completion of 6 months 2 days,(It is considered that leave is eligible only after completion of 6 months)
=IFS(G1>=12,G1*2.5,G1>=6,G1*2,TRUE,0)
=IF(G1>=12,G1*2.5,IF(G1>=6,G1*2,0))
Months IFS IF
12 30 30
7 14 14
5 0 0
=IFS(A2>=12,A2*2.5,A2>=6,A2*2,TRUE,0)
=IF(A2>=12,A2*2.5,IF(A2>=6,A2*2,0))