We have a charity and the money coming in (Donation) and going out (expense) we keep the accounts in an excel.

I have 3 rows, one is for Invoice number, I specify invoice number in running order for money in and out.
2nd is type of transaction (donation/Expense)
the last is the amount of money we are taking out of the bank or putting in the bank.
We have a pivot table that keeps tab of the in and out of the bank account.
I have 1000 in my bank account.
So for eg, My invoice number (row A) 0001, it is an expense (row 2) as we are taking the money out of our charity and giving it to the beneficiary. row 3 is our amount we are taking out, which is 2000. So we have 5 beneficiary, each getting 400 dollars each. We need to issue invoice to them too, and we generate those in the same excel.
i want to create a command that does the following:
First it checks if it is a donation or an expense, if it is a donation it stops operation, if it is expense it moves on to checking the invoice number on Row A, if the invoice number has a alphabet behind the actual number (eg 0001-A) the amount in row 3 will be taken as void. that is it would not be taken into account in my pivot table which is keeping tab of my donation and expense. if someone can help me with it i would be very very very grateful! Thanks thanks thanks!!