To calculate VAT having the gross amount you should divide the gross amount by 1 + VAT %. (i.e if it is 20 percent , then you need to divide by 1.20), then deduct the total amount.