Something like this formula used in Allocations!F2 and copied down should do what you need. The formula needs your cell references for the leave credits.
Formula:
=if(INDEX(Import!G:G,MATCH(Allocations!A2,Import!B:B,0))="approved",subtract amount approved,"not approved")
As a side note, I think that subtracting the leave upon approval and before the leave has been taken is a mistake. I kept track of leave for over 30 employees for more than 10 years and quite often the vacation dates had to be adjusted either by the applicant or the employer. Operational requirements of the company can change drastically very quickly so giving final approval for leave too soon can cause some very big headaches for everyone.
I think that you would be better off in the long term if you can get access to a relational database for this as it handles these problems much better and has the capacity to handle much more data. (IMHO)
Bookmarks