+ Reply to Thread
Results 1 to 6 of 6

IF formular with multiple rules

  1. #1
    Registered User
    Join Date
    09-27-2011
    Location
    liverpool
    MS-Off Ver
    excel 2010
    Posts
    3

    IF formular with multiple rules

    Hi guys,

    This is a pretty simple formula question, but I can't find the answer anywhere (im probably not searching for the correct key words).

    Im trying to write a formular to work out VAT rates.

    Say A1=Date, B1=Amount, and C1=VAT rate. The formular will be written into C1, and needs to apply the following rules;
    If A1<01/12/08,B1*0.175

    If A1>01/12/08, but<01/10/10, B1*0.15

    If A1>01/01/10, but <04/01/10, B1*0.175

    If A1> 04/01/11, B1*0.20

    I hope this makes sense. I have tried linking the various rules a number of ways but can't find the soloution. It allways seems to give cummaltive VAT rate (so something like .17.5 + .15 say) or gives a 0. I think the problem is I dont know how to write the "but" correctly

    Thanks a lot.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: IF formular with multiple rules

    Please Login or Register  to view this content.
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Forum Guru Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,093

    Re: IF formular with multiple rules

    Try

    =B1*IF(A1<--"2008-12-01",17.5%,IF(A1<--"2010-01-01",15%,IF(A1<--"2010-04-01",17.5%,20%)))

  4. #4
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    MS 2007, 2010
    Posts
    12,436

    Re: IF formular with multiple rules

    Simplest way is to work from largest to smallest. Then you don't need to use any AND statements (i.e. AND(A1> 1/12/08, A1< 1/10/10))

    =IF(A1>DATEVALUE("4/1/2011"),B1*0.2,IF(A1>DATEVALUE("1/1/2010"),B1*0.175,IF(A1>DATEVALUE("1/12/2008"),B1*0.015,B1*0.175)))
    Does that work for you?
    ChemistB
    My 2

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  5. #5
    Registered User
    Join Date
    09-27-2011
    Location
    liverpool
    MS-Off Ver
    excel 2010
    Posts
    3

    Re: IF formular with multiple rules

    thanks for that guys.

    The only one that worked when I copied and pasted it directly into excel was tlafferty's (maybe because it was written in a different format??).

    Anyway, that's good enough for me.

    It's going to save me and my colleauges a lot of time, and prevent the wrong VAT rate being applied on invoices.

    Thank you again.

  6. #6
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: IF formular with multiple rules

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save


    Also, next time you crosspost, please make sure you provide links to any and all posts in other forums.
    Remember what the dormouse said
    Feed your head

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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