Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default Nested "IF" statement

Is there a way to combine these into one IF statement? I need to reference
the state and the date to determine the percentage to apply to the
calculation. For example, if the state is GA and the date is between
20030501 and 20040430 apply 4%, if the state is AL and the date is between
20050501 and 20060430, apply 3.5% etc.

These are the formulas and states (I6 is the date being referenced)

AL =IF(I6=20070501,0.006,IF(I6=20060501<=20070430,0 .005,IF(I6=20040501<=20060430,0.007,IF(I6=200205 01<=20040430,0.009,0))))
DC =IF(I6=20070501,0.111,0)
GA =IF(I6=20060501<=20070430,0.088,
IF(I6=20040501<20060430,0.116,IF(I6=20020501<=20 040430,0.081,0)))
ID =IF(I6=20040501<=20060430,0.033,IF(I6=20060501,0 .031,0))
KS =IF(I6=20070501,0.034,IF(I6=20060501<=20070430,0 .035,IF(I6=20040501<=20060430,0.032,IF(I6=200205 01<=20040430,0.04,0.094))))
MN =IF(I6=20010501<=20020430,0.162,IF(I6=20020501<= 20030430,0.107,0))
SC =IF(I6=20070501,0.245,IF(I6=20060501<=20070430,0 .194,IF(I6=20040501<=20060430,0.23,IF(I6=2002050 1<=20040430,0.158,0.145))))
WI =IF(I6=20070501,0.018,0)






  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 220
Default Nested "IF" statement

Excel has a limit of 7 nested IF statements. I would suggest using a
custom formula like this:

Public Function CalcTax(st As String, amt As Long) As Double
Application.Volatile
Select Case st
Case "AL"
tax = 0.035
Case "GA"
tax = 0.04
End Select
CalcTax = Round(amt * tax, 2)
End Function

--
Dan


On Apr 14, 11:18*am, Cindy - Atlanta,GA <Cindy -
wrote:
Is there a way to combine these into one IF statement? *I need to reference
the state and the date to determine the percentage to apply to the
calculation. *For example, if the state is GA and the date is between
20030501 and 20040430 apply 4%, if the state is AL and the date is between
20050501 and 20060430, apply 3.5% etc.

These are the formulas and states (I6 is the date being referenced)

AL * * *=IF(I6=20070501,0.006,IF(I6=20060501<=20070430, 0.005,IF(I6=20040501<=200*60430,0.007,IF(I6=2002 0501<=20040430,0.009,0))))
DC * * *=IF(I6=20070501,0.111,0)
GA * * *=IF(I6=20060501<=20070430,0.088,
IF(I6=20040501<20060430,0.116,IF(I6=20020501<=20 040430,0.081,0)))
ID * * *=IF(I6=20040501<=20060430,0.033,IF(I6=20060501, 0.031,0))
KS * * *=IF(I6=20070501,0.034,IF(I6=20060501<=20070430, 0.035,IF(I6=20040501<=200*60430,0.032,IF(I6=2002 0501<=20040430,0.04,0.094))))
MN * * *=IF(I6=20010501<=20020430,0.162,IF(I6=20020501< =20030430,0.107,0))
SC * * *=IF(I6=20070501,0.245,IF(I6=20060501<=20070430, 0.194,IF(I6=20040501<=200*60430,0.23,IF(I6=20020 501<=20040430,0.158,0.145))))
WI * * *=IF(I6=20070501,0.018,0)

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Nested "IF" statement

Why don't you try using a Pivot Table. I've used Pivot Tables many times in
the past to overcome the 7-limit (limitation) of if functions.
http://peltiertech.com/Excel/Pivots/pivottables.htm
http://www.contextures.com/xlPivot02.html

Regards,
Ryan--



--
RyGuy


"Dan R." wrote:

Excel has a limit of 7 nested IF statements. I would suggest using a
custom formula like this:

Public Function CalcTax(st As String, amt As Long) As Double
Application.Volatile
Select Case st
Case "AL"
tax = 0.035
Case "GA"
tax = 0.04
End Select
CalcTax = Round(amt * tax, 2)
End Function

--
Dan


On Apr 14, 11:18 am, Cindy - Atlanta,GA <Cindy -
wrote:
Is there a way to combine these into one IF statement? I need to reference
the state and the date to determine the percentage to apply to the
calculation. For example, if the state is GA and the date is between
20030501 and 20040430 apply 4%, if the state is AL and the date is between
20050501 and 20060430, apply 3.5% etc.

These are the formulas and states (I6 is the date being referenced)

AL =IF(I6=20070501,0.006,IF(I6=20060501<=20070430,0 .005,IF(I6=20040501<=200Â*60430,0.007,IF(I6=2002 0501<=20040430,0.009,0))))
DC =IF(I6=20070501,0.111,0)
GA =IF(I6=20060501<=20070430,0.088,
IF(I6=20040501<20060430,0.116,IF(I6=20020501<=20 040430,0.081,0)))
ID =IF(I6=20040501<=20060430,0.033,IF(I6=20060501,0 .031,0))
KS =IF(I6=20070501,0.034,IF(I6=20060501<=20070430,0 .035,IF(I6=20040501<=200Â*60430,0.032,IF(I6=2002 0501<=20040430,0.04,0.094))))
MN =IF(I6=20010501<=20020430,0.162,IF(I6=20020501<= 20030430,0.107,0))
SC =IF(I6=20070501,0.245,IF(I6=20060501<=20070430,0 .194,IF(I6=20040501<=200Â*60430,0.23,IF(I6=20020 501<=20040430,0.158,0.145))))
WI =IF(I6=20070501,0.018,0)


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nested "If Statement" The Greek Excel Discussion (Misc queries) 4 March 16th 08 11:43 AM
Nested If Statement "FALSE" Return Margie Excel Worksheet Functions 8 August 17th 07 11:37 PM
nested "If statement" using text RonB Excel Worksheet Functions 2 February 15th 07 05:10 PM
embedding "ISERROR" function into an "IF" statement [email protected] Excel Worksheet Functions 8 January 4th 07 12:01 AM
Nested "IF" Statement lajohn63 Excel Worksheet Functions 1 October 6th 06 10:56 AM


All times are GMT +1. The time now is 04:31 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"