+ Reply to Thread
Results 1 to 8 of 8

Formula Syntax Query - Excell 2010

  1. #1
    Registered User
    Join Date
    07-29-2010
    Location
    London, England
    MS-Off Ver
    Excel 2010
    Posts
    1

    Formula Syntax Query - Excell 2010

    All, I am new to this forum, and Excel and am hoping that someone can provide some guidance on my below query.

    I am attempting to use a nested IF statement to deliver a reslt based on multiple conditions. The first 2 IF statements deliver the correct result, however the third IF statement produces a #VALUE! message. Having played with the syntax for a number of hours I am no where nearer to uncovering the error.

    =IF(B22<=5,B22*B17,IF(B22<=10,(5*B17)+(B22-5)*C17)),IF(B22<=15,((5*B17)+(5*C17)+(B22-10))*D17)

    Attached is a screenshot that displays what I am attempting.

    Any assistance would be greatly appreciated.


    Best regards
    Attached Files Attached Files

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula Syntax Query - Excell 2010

    maybe
    =IF(B22<=5,B22*B17,IF(B22<=10,((5*B17)+(B22-5))*C17,IF(B22<=15,((5*B17)+(5*C17)+(B22-10))*D17,"something")))

    fyi its easier to check if you split it into its components
    =IF(B22<=5,B22*B17,
    IF(B22<=10,(5*B17)+(B22-5)*C17)),
    IF(B22<=15,((5*B17)+(5*C17)+(B22-10))*D17
    then you can see
    IF(B22<=10,(5*B17)+(B22-5)*C17)), is not quite right
    it needs to be IF(B22<=10,(5*B17)+(B22-5)*C17,
    or perhaps
    IF(B22<=10,((5*B17)+(B22-5))*C17),
    but i dont know which you actually want
    also you have not specified what to do if all 3 conditions not met
    Last edited by martindwilson; 07-29-2010 at 06:49 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Formula Syntax Query - Excell 2010

    Instead of a screenshot, you should have posted the Excel sheet (replace confidential info with dummy data)

    counting the brackets in your formula, I think you are closing some IFs too early. Try

    Please Login or Register  to view this content.
    Your last nested if does not have a statement for False. You may want to do something about that.

  4. #4
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,372

    Re: Formula Syntax Query - Excell 2010

    ah, Martin, you in the morning, me at night, but the same gist!

  5. #5
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula Syntax Query - Excell 2010

    The parentheses are still out of kilter if this is a tiered calculation - only B22-10 should be multiplied by D17.

    If preferred you can conduct tiered commission calcs with SUMPRODUCT - see: http://www.mcgimpsey.com/excel/variablerate.html

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula Syntax Query - Excell 2010

    For sake of SUMPRODUCT example - see attached
    (add cap if nec.)
    Attached Files Attached Files

  7. #7
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: Formula Syntax Query - Excell 2010

    hmm run before walk springs to mind!

  8. #8
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Formula Syntax Query - Excell 2010

    Perhaps though personally I would argue that when it comes to tiered calculations the SUMPRODUCT approach is generally the simplest to manage and adapt long term.
    The greater the number of tiers the more sense it makes to use SUMPRODUCT.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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