You could adjust the percentages to get the lowest tax rate and scale up from there.
If 90210 had a tax rate of 7.25 and that was the lowest then you'd set the State Tax rate at that percentage and add from there.
Pseudo code here:
Code:
taxModifier = StateTaxRate - MINIMUM( ZipTaxRates )
newStateTaxRate = StateTaxRate - taxModifier
for each zipTax in ZipTaxRates {
newZipTax = zipTax - newStateTaxRate
// Write newZipTax to Database
}
// Write newStateTaxRate to Database
This assumes that your table has full tax rates ( not broken down )
So, to go through the logic, you can check it against this list 8.25, 8.5, 8.00 7.25
First, it finds the lowest tax rate: 7.25 and that's the new State Tax Rate.
Then it iterates through the zipTaxRates.
So
8.25 becomes 7.25 + 1.0
8.5 becomes 7.25 + 1.25
8.0 becomes 7.25 + .75
7.25 becomes 7.25 + 0.0
...
Of course, this also means you have to have every single possible zip... which is probably not practical.