+ Reply to Thread
Results 1 to 11 of 11

IF statements...If something is greater than X, less than Y.

  1. #1
    Registered User
    Join Date
    05-18-2020
    Location
    Cardiff
    MS-Off Ver
    Office 365
    Posts
    4

    Question IF statements...If something is greater than X, less than Y.

    I am an accountant and I'm creating a spreadsheet that will calculate your tax for you based on your earnings.

    I'm having difficulty getting the IF statement to correctly calculate the tax on Non-Savings, Savings and Dividend income when it reaches the Higher and Additional rates of tax.

    If anyone can help, that would be great!!

    Thanks in advance

  2. #2
    Forum Expert
    Join Date
    09-07-2014
    Location
    Israel
    MS-Off Ver
    office 365 for MAC
    Posts
    3,105

    Re: IF statements...If something is greater than X, less than Y.

    How about posting a file for example?
    The yellow banner at the top of the page gives instructions as for how to upload your file.

  3. #3
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: IF statements...If something is greater than X, less than Y.

    Welcome to the forum.

    There are instructions at the top of the page explaining how to attach your sample workbook.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  4. #4
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,425

    Re: IF statements...If something is greater than X, less than Y.

    Something like
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  5. #5
    Registered User
    Join Date
    05-18-2020
    Location
    Cardiff
    MS-Off Ver
    Office 365
    Posts
    4

    Re: IF statements...If something is greater than X, less than Y.

    I've attached the spreadsheet for you guys to take a look. The cells highlighted in orange are the formulas i need help with.

    If someone could call me (on Microsoft Teams) to go through this that would be great.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: IF statements...If something is greater than X, less than Y.

    No, that's not going to happen (the Teams bit) - sorry.

    Please understand that this is not just a place for you to get help, but each thread is part of a permanent database that is extensively trawled, therefore ALL help has to be given within the thread. I am sure you will understand.

  7. #7
    Registered User
    Join Date
    05-18-2020
    Location
    Cardiff
    MS-Off Ver
    Office 365
    Posts
    4

    Re: IF statements...If something is greater than X, less than Y.

    Ok thanks, do I need to post each and every query through this forum then? May take a while

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,779

    Re: IF statements...If something is greater than X, less than Y.

    It's what everybody has to do. We seem to get by just fine!

  9. #9
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,820

    Re: IF statements...If something is greater than X, less than Y.

    How much is trouble with the actual IF() or IFS() function, and how much is just trying to understand the logic that you are trying to apply? I'm not sure I understand the logic, so I cannot suggest a set of formulas.

    As a guess, it looks like:
    1) The first up to 37500 is taxed at the first rate -- A26=MIN(C22,C7)
    2) Then next up to 112500 (up to a total of 150000) is taxed at the second rate -- A27 =MIN(F7-C7,MAX(C22-A26,0))
    3) Anything over 150000 total is taxed at the third rate -- A28=MAX(C22-SUM(A26:A27),0)

    I ended up not using any IF() functions for that. Did I guess right or even close?
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  10. #10
    Registered User
    Join Date
    05-18-2020
    Location
    Cardiff
    MS-Off Ver
    Office 365
    Posts
    4

    Re: IF statements...If something is greater than X, less than Y.

    Ok, let's give this a go at explaining then.

    These are all for the Interest section only.

    A33 = that cell needs to calculate the remainder of whatever is in cell D22, less A32 and A29 up to the value of £37,500. However, if cell F22 is greater than £37,500, then it must be 0.

    A34 = this must calculate the remainder of whatever is in cell D22, less A33, A32 and A29 up to the value of £150,000. However, if cell C22 is greater than £150,000 then it must be 0.

    A35 = if cell C22 is greater than £150,000, then all of D22 must be included within this cell and none of the other cells (A34, A33 or A32)

  11. #11
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,820

    Re: IF statements...If something is greater than X, less than Y.

    I find that part of learning to program a spreadsheet is learning to solve small problems, and then combine them into something bigger. For example:
    A33 = that cell needs to calculate the remainder of whatever is in cell D22, less A32 and A29 up to the value of £37,500.
    Can you see how my MIN() function solves this part of the problem MIN(37500,D22-A32-A29)? Anywhere in your spreadsheet where you have a "perform calculation up to a specified maximum" problem, you should be able to use a MIN() function.

    The other part of A33
    However, if cell F22 is greater than £37,500, then it must be 0.
    is a simple IF() where it will choose between returning 0 or returning the result of the MIN() function. IF(F22>37500,0,MIN(...))

    Later, you add another condition to A33
    if cell C22 is greater than £150,000, then all of D22 must be included within this cell and none of the other cells (A34, A33 or A32)
    We can add another IF() layer to A33 =IF(C22>150000,0,IF(F22>37500,...))

    A34 should be very similar to A33.
    A35 appears to be a simple choice between 0 and D22, based on whether C22 is greater than 150000 -- another simple IF() function =IF(C22>150000,D22,0)

+ 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. Multiple IF Statements / Equal to Greater than etc.
    By thenotoriousjeff in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-06-2014, 02:31 PM
  2. [SOLVED] Having trouble with IF, AND, OR logic with several greater than statements.
    By addymarie in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-10-2013, 04:32 PM
  3. Formula for Greater Than Statements
    By busby22 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 10-11-2012, 02:12 PM
  4. Greater than in if statements?
    By IRMacGuyver in forum Excel General
    Replies: 6
    Last Post: 09-13-2011, 08:44 PM
  5. Overcoming greater than 7 if statements
    By puffer in forum Excel General
    Replies: 6
    Last Post: 04-28-2009, 02:06 PM
  6. greater than or less than if statements
    By ERG in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-25-2006, 10:20 AM
  7. IF Statements-greater than
    By Rick Scott via OfficeKB.com in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-20-2005, 10:05 AM

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