Hi
Somehow I feel you have leaved a lot of usefull information out here! What
about the table where you want this base amount to put in (counties table?)?
And the table with customer information? Have you for every customer a
single row in sales table, which you overwrite again, or do you add new rows
after some time (But then you would have some date colum there too! Again,
with single row for customer, why to have as separate customers table at
all.)? Is there for every customer a single row in county table, or a row
for every county, or otherwise? Is tax same for all counties?
With several entries for customer in sales table, which all are counted in
(p.e. all belong to same month), with different taxes for counties, and an
entry for every customer in counties table, you can consider next design
Counties table/sheet
Counties: County, TaxPercent, Sales, Tax
Define named ranges County, CountyTable
County=OFFSET(Counties!$A$1,,,COUNTIF(Counties!$A:$A,"<>")-1,1)
CountyTable=OFFSET(Counties!$A$1,,,COUNTIF(Counties!$A:$A,"<>")-1,2)
Fill in County column
Customers table/sheet
Customers: Customer, County, Sales, Tax
Define named ranges Customer, County, Sales, Tax, CustTable
Customer=OFFSET(Customers!$A$1,,,COUNTIF(Customers!$A:$A,"<>")-1,1)
CustTable=OFFSET(Customers!$A$1,,,COUNTIF(Customers!$A:$A,"<>")-1,4)
Format a range in County column with Data.Validation.List(Source=County)
Fill Customer and County columns for every customer.
Sales table/sheet
Sales:Customer, Sales, Tax, County
Format a range in Customer column with Data.Validation.List(Source=Customer)
Into cell C2 (Tax) enter the formula
=IF(B2="","",IF(ISERROR(VLOOKUP(D2,CountyTable,2,FALSE)),"",B2*VLOOKUP(D2,Co
untyTable,2,FALSE)))
Into cell D2 enter the formula
=IF(ISERROR(VLOOKUP(A2,CustTable,2,FALSE)),"",VLOOKUP(A2,CustTable,2,FALSE))
Copy both formulas down for some amount of rows
Define named ranges SalesCust, SalesSales, SalesTax, SalesCounty, SalesTable
SalesCust=OFFSET(Sales!$A$1,,,COUNTIF(Sales!$A:$A,"<>")-1,1)
SalesSales=OFFSET(Sales!$B$1,,,COUNTIF(Sales!$A:$A,"<>")-1,1)
SalesTax=OFFSET(Sales!$C$1,,,COUNTIF(Sales!$A:$A,"<>")-1,1)
SalesCounty=OFFSET(Sales!$D$1,,,COUNTIF(Sales!$A:$A,"<>")-1,1)
SalesTable=OFFSET(Sales!$A$1,,,COUNTIF(Sales!$A:$A,"<>")-1,4)
In Customers table:
Into cell C2 enter the formula
=SUMPRODUCT((SalesCust=A1)*(SalesSales))
Into cell D2 enter the formula
=SUMPRODUCT((SalesCust=A1)*(SalesTax))
And copy formulas down for every customer
In Counties table:
Into cell C2 enter the formula
=SUMPRODUCT((SalesCounty=A1)*(SalesSales))
Into cell D2 enter the formula
=SUMPRODUCT((SalesCounty=A1)*(SalesTax))
And copy formulas down for every county