Frank, I need your help, PLEASE

  • Thread starter Thread starter bianca
  • Start date Start date
B

bianca

I'm trying to create a worksheet that will calculate sales tax for eac
county in my state. Problem is that each county has a different rate
I've created a formula that worked but when I tried to add the last tw
counties, excel said my formula was too long. I don't know how t
shorten it. Some of the counties are multipied by the same number - i
there a way around the problem?

The cell I'm writing the formula for is M8, but I'm going to use th
same in cells M10 and M12.

Can you please take a look and see if I can get around this problem?

Thank you!

Bianc

Attachment filename: sales & use tax wksht.xls
Download attachment: http://www.excelforum.com/attachment.php?postid=63035
 
Bianca,

You should use a VLOOKUP formula instead of nested IF statements.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Few sensible people open workbooks posted by people they don't know
More often than not they're unnecessary.

bianca wrote...
I'm trying to create a worksheet that will calculate sales tax for
each county in my state. Problem is that each county has a
different rate - I've created a formula that worked but when I
tried to add the last two counties, excel said my formula was
too long. I don't know how to shorten it. Some of the counties
are multipied by the same number - is there a way around the
problem?
...

More likely than not your formula looks something like

=IF(OR(CountyName={"North";"Hill";"Lake"}),0.05,
IF(OR(CountyName={"South";"Jefferson"},0.0525,
...
)

and you have 7 different tax rates. Excel has a limit of 7 neste
function calls, which means you can't use arbitrarily many IF call
inside other IF calls.

You should create a 2-column table of county names in the left colum
and corresponding tax rates in the right column. Then use VLOOKUP
Assuming you'd sorted this table by county name in ascending order,

=VLOOKUP(CountyName,CountyRateTable,2)

would return the tax rate corresponding to CountyName
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top