It is a formula in excel to execute employee tax,meanwhile i want to use it Access.so

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SamuelTad
    New Member
    • Jul 2014
    • 15

    It is a formula in excel to execute employee tax,meanwhile i want to use it Access.so

    Code:
    =if(p5>5000,p5*0.35-662.5,if(p5>3551,p5*0.3412.5,if(p5>2351,p5*0.25-235,if(p5>1401,p5*0.2-117.5,if(p5>651,p5*0.15-47.5,if(p5>=151,p5*0.1-15,0))))))
    Where
    P5=Gross salary
    Last edited by NeoPa; Jul 26 '14, 09:48 PM. Reason: Clarification only - {NeoPa} Added tags.
  • twinnyfo
    Recognized Expert Moderator Specialist
    • Nov 2011
    • 3664

    #2
    Is there a specific question here? We are willing to help, but you have given us nothing to go on.

    Comment

    • SamuelTad
      New Member
      • Jul 2014
      • 15

      #3
      Well to make my self clear,P5 is Gross salary,therefor e if salary is > $5000.00 tax is undergoes like "P5 * 35% then subtract 662.5 from the new Gross salary" up to the least salary.so convert this formula in to access expression.than ks!!

      Comment

      • twinnyfo
        Recognized Expert Moderator Specialist
        • Nov 2011
        • 3664

        #4
        You are actually already there, but you need to change the "If" statements to "IIf" statements. It should translate perfectly....

        Comment

        • SamuelTad
          New Member
          • Jul 2014
          • 15

          #5
          Hi Twinny appreciate for quick respond!!
          I put everything in this manner but it says syntax error
          Code:
          iif([Gross Salary]>[5000]
             ,[Gross Salary]*[0.35-662.5]
             ,IF([Gross Salary]>[3551]
                ,[Gross Salary]*[0.3-412.5]
                ,iif([Gross Salary]>[2351]
                   ,[Gross Salary]*[0.25-235]
                   ,iif([Gross Salary]>[1401]
                      ,[Gross Salary]*[0.2-117.5]
                      ,iif([Gross Salary]>[651]
                         ,[Gross Salary]*[0.15-47.5]
                         ,iif([Gross Salary]>=[151]
                               ,[Gross Salary]*[0.1-15,0]
          ))))))
          Last edited by zmbd; Aug 1 '14, 12:10 AM. Reason: [z{placed required code tags}{stepped the code for reading}]

          Comment

          • twinnyfo
            Recognized Expert Moderator Specialist
            • Nov 2011
            • 3664

            #6
            Remove all the braces from around your numbers:

            Code:
            =IIf(p5>5000
               ,p5*0.35-662.5
               ,IIf(p5>3551
                  ,p5*0.3412.5
                  ,IIf(p5>2351
                     ,p5*0.25-235
                     ,IIf(p5>1401
                        ,p5*0.2-117.5
                        ,IIf(p5>651
                           ,p5*0.15-47.5
                           ,IIf(p5>=151
                              ,p5*0.1-15
                              ,0)
            )))))
            Last edited by zmbd; Aug 1 '14, 12:13 AM. Reason: [z{stepped the code for reading}]

            Comment

            • SamuelTad
              New Member
              • Jul 2014
              • 15

              #7
              Cheer,thanks a lot it works!!

              Comment

              Working...