And we need to know more about your system before we can suggest much.
There are 5 different quantity fields and 5 corresponding but unrelated margin fields.
Does that mean that you have 10 fields, 5 for quantity and 5 for their corresponding margins?
What does a single record in this table represent? A single item in your Product table? A specific customer? Could there be more than 5 such pairs of fields? Can you provide a sample margin calculation and explain how it might be different for different quantities and customers?
or ideally when inputing a new quantity a calculation field which would give a suggested margin based on the customer code
Would this represent a 6th pair of such fields or an update to one of the 5 that you describe? Is this for one product for one customer? Or all products that customer might purchase? How does the identity of the customer affect the margin calculation? (Type of customer, past sales history, current order quantities, or ?...)
I think I've made this way too complicated. Perhaps a better way to go about this might be, I have a max margin and a min margin within a found set I I could just calculate the 1/5 fraction for the remaining three in the middle that would work well. Then I could do the same with the corresponding quantities.