I have three columns that give in order the number of small items (column A), the number of medium items (column B) and the number of large items (column C).
Each of the quantities can be anything from 0 to 999.
There is a charge made for the total number of items. The charge is calculated on a price for the first one and then a set rate for each of the subsequent of that type.
Only the first of the largest items is charged at the first item rate, then the rest of those type and each of any of a smaller type are charged at the subsequent rate.
So if there are 3 large 3 medium and 3 small the first of the large is charged at the first rate for large, then the other 2 large are charged at the subsequent rate and the 3 medium and 3 small are charged all at the subsequent rate for that type.
If there are no large, 3 medium and 3 small then the first medium item is charged at the first rate for medium, the other two medium charged at the subsequent medium rate and the three small charged each at the subsequent small rate.
The charges for first and subsequent for each category are else where in the spreadsheet say for the purpose of the example
M1 First Small charge (per unit) N1 small subsequent charge (per unit)
M2 First Medium charge (per unit) N2 medium subsequent charge (per unit)
M3 First large charge (per unit) N3 large subsequent charge (per unit)
I would like help with a code to work out the total charge.
Hope you can help
Each of the quantities can be anything from 0 to 999.
There is a charge made for the total number of items. The charge is calculated on a price for the first one and then a set rate for each of the subsequent of that type.
Only the first of the largest items is charged at the first item rate, then the rest of those type and each of any of a smaller type are charged at the subsequent rate.
So if there are 3 large 3 medium and 3 small the first of the large is charged at the first rate for large, then the other 2 large are charged at the subsequent rate and the 3 medium and 3 small are charged all at the subsequent rate for that type.
If there are no large, 3 medium and 3 small then the first medium item is charged at the first rate for medium, the other two medium charged at the subsequent medium rate and the three small charged each at the subsequent small rate.
The charges for first and subsequent for each category are else where in the spreadsheet say for the purpose of the example
M1 First Small charge (per unit) N1 small subsequent charge (per unit)
M2 First Medium charge (per unit) N2 medium subsequent charge (per unit)
M3 First large charge (per unit) N3 large subsequent charge (per unit)
I would like help with a code to work out the total charge.
Hope you can help