Hi G,
OK, I think (after about three attempts) I have the table structure determined.
Column: Contents
A: Unique ID Number for each receipt.
B: Transaction date
C: Month (calculated from B)
D: Receipt number? Supplier? (does not enter into calculations?)
E: Input column: 1+tax rate for receipts where only the tax-in total is provided.
F: Input column: Tax-in amount for this category of receipt
G: Net (tax-out) amount calculated from E & F
H: Tax (Calculated from E & F)
I: Input column: Net amount subject to 7% VAT
J: Tax on amount in I (calculated)
K: Input column: Net amount subject to 19% VAT
L: Tax on amount in K (calculated)
M: Gross (Tax-in) amount (sum of columns I-L)
N: Cumulative Tax total to this row. (sum of J,K)
M and N appear to ignore any amounts in column H.
With the conditions you describe:
---Some receipts list only gross amounts, and must have the tax extracted from them
---Gross amounts in above receipts can include tax at either 7% or 19% (but at only one rate within a single receipt)
---Some receipts contain net amounts subject to 7% VAT AND net amounts subject to 19% VAT
---Each receipt is recorded on a single line
Given those restrictions, I think you are already at the minimum number of columns. The only change needed is to include column H in the cumulative tax calculation.
The largest design issue I see is the intermixing of input and calculation columns. Separating those would reduce the likelihood of accidently destroying one or more of the formulas with an accidentally misplaced click and keystoke.
If the receipts could be reduced to each having items of only a single category from the list below, it is probably possible to reduce the number of input columns to 2: One for the receipt amount (which could be either a before tax, net amount or a tax included gross amount), and a second column containing a five item pop-up menu:
" " (single space, indicating no entry yet made
Brutto: 07%
Brutto: 19%
Netto: 07%
Netto: 19%
This would allow a set of nested IF statement to:
- Suppress the calculation if the first character is a space.
- Choose the formula to calcualte the tax based on the first character of the menu item.
- Determine the tax rate to use in the formula from the rightmost three characters of the menu item.
And allow the Gross amount currrently in column M to be calculated from the first input column plus zero (if that was already the gross amount) or the result of the tax calculation above (if the input was a net amount).
This could also be done with a pair of checkboxes replacing the buttom four choices on the pop-up menu, and a LEN(A)<1 test to determine if an entry has been made:
Three formulas, each entered in row 2 and filled down from there.
D2: =IF(LEN(A)<1,"",IF(B,A-A/IF(C,1.19,1.07),A*IF(C,0.19,0.07)))
F2: =IF(LEN(D)<1,"",A+IF(B,0,D))
G2: =IF(LEN(D)<1,"",SUM($D$2:D2))
Regards,
Barry