+ Reply to Thread
Results 1 to 5 of 5

Need help on complex IF function

  1. #1
    Registered User
    Join Date
    10-29-2014
    Location
    New York, NY
    MS-Off Ver
    8.1
    Posts
    3

    Need help on complex IF function

    I'm trying to create a function that determines the appropriate federal tax rate based on the company's earnings before taxes.

    To illustrate, I'm trying to write a function that basically says "if(Earnings for year 1 are either greater than or equal to zero and less than $50k, then the tax rate is 15%, otherwise if(earnings for year 1 are either greater than or equal to $50k and less than $75k, then taxes are $7,500, otherwise if(earnings for year 1 are either greater than or equal to $75K and less than $100k, then taxes are $13750, and on so on...

    Any help would be much appreciated

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Need help on complex IF function

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    10-29-2014
    Location
    New York, NY
    MS-Off Ver
    8.1
    Posts
    3

    Re: Need help on complex IF function

    Ok so here's what I did:

    Cell B12 on my spread sheet I renamed to "earnings" since that is the income number. Below is the code (please keep in mind I'm am absolute amateur at VBA). When I try to run the function the only number getting returned is 0. Not sure where I'm going wrong.

    Function Calc_Tax(earnings) As Double
    Select Case earnings
    Case Is < 50000
    Calc_Tax = 15
    Case Is >= 50000 < 75000
    Calc_Tax = 7500
    Case Is >= 75000 < 100000
    Calc_Tax = 13750
    Case Is >= 100000 < 335000
    Calc_Tax = 22250
    Case Is >= 335000 < 10000000
    Calc_Tax = 113900
    Case Is >= 10000000 < 15000000
    Calc_Tax = 3400000
    Case Is >= 15000000 < 18333333
    Calc_Tax = 5150000
    Case Is >= 18333333
    Calc_Tax = 35
    End Select
    End Function

  4. #4
    Forum Expert boopathiraja's Avatar
    Join Date
    07-12-2013
    Location
    Coimbatore,TamilNadu, India
    MS-Off Ver
    Excel 2007, 2013, 2016, 365
    Posts
    1,455

    Re: Need help on complex IF function

    hi, tRY THE BELOW formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Click just below left if it helps, Boo?ath?

  5. #5
    Registered User
    Join Date
    10-29-2014
    Location
    New York, NY
    MS-Off Ver
    8.1
    Posts
    3

    Re: Need help on complex IF function

    Quote Originally Posted by boopathiraja View Post
    hi, tRY THE BELOW formula

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Thank you, this works.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Creating a function to simplify a more complex function
    By mk74 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-29-2011, 08:43 AM
  2. Complex IF function
    By kents86 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-05-2010, 07:50 AM
  3. Complex function
    By Arby in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-30-2007, 01:14 PM
  4. [SOLVED] complex function
    By LostSam in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-02-2006, 09:00 PM
  5. Complex if and mid function.
    By brookdale in forum Excel Formulas & Functions
    Replies: 27
    Last Post: 09-06-2005, 12:05 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1