+ Reply to Thread
Results 1 to 10 of 10

Nested if formula not working as intended

  1. #1
    Registered User
    Join Date
    09-11-2013
    Location
    Roodepoort, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Nested if formula not working as intended

    Hi People

    I desperately require help on a formula that I have created.

    The purpose of the formula is to find the biggest % of three tests, when the highest average has been found, the formula must then calculate the overall term average, weighting the highest average the most and the other two tests the least. All the tests and a practical average must = 100%


    This is the formula i currently have:

    =IF(AND(D2>F2,D2>H2),((D2*0.3)+(F2*0.15)+(H2*0.15)+(J2*0.4))),IF(AND(F2>D2,F2>H2),((F2*0.3)+(D2*0.15)+(H2*0.15)+(J2*0.4))),IF(AND(H2>D2,H2>F2),((H2*0.3)+(F2*0.15)+(D2*0.15)+(J2*0.4)),0)

    This returns a #value error.

    Any assistance will be welcomed

    Thanks
    DK

  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: Nested if formula not working as intended

    i think you went a bit mad there with ()
    =IF(AND(D2>F2,D2>H2),D2*0.3+F2*0.15+H2*0.15+J2*0.4,IF(AND(F2>D2,F2>H2),F2*0.3+D2*0.15+H2*0.15+J2*0.4,IF(AND(H2>D2,H2>F2),H2*0.3+F2*0.15+D2*0.15+J2*0.4,0)))
    "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
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Nested if formula not working as intended

    Hi,

    Could you please upload your workbook?

    Thanks

  4. #4
    Registered User
    Join Date
    09-11-2013
    Location
    Roodepoort, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Nested if formula not working as intended

    Hi thanks for the quick response:

    Please find attached my workbook
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor TheCman81's Avatar
    Join Date
    11-06-2012
    Location
    Edinburgh, UK
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    346

    Re: Nested if formula not working as intended

    Excel Guru in the making

    <----------If the question has been answered to your satisfication please click the Add Repuation star to the left

  6. #6
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Nested if formula not working as intended

    Hi again,

    As Martin said, you just went overboard with the brackets. Here is the corrected formula:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Hope this helps

  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: Nested if formula not working as intended

    you still dont need all those ((D2*0.3)+(F2*0.15)+(H2*0.15)+(J2*0.4))
    is the same as
    D2*0.3+F2*0.15+H2*0.15+J2*0.4

  8. #8
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Nested if formula not working as intended

    @Martin: yeah I know, but I was trying to keep the formula as close as possible to the original (except for the making it actually work part :P), as I find that this makes it easier for the original poster to comprehend

  9. #9
    Registered User
    Join Date
    09-11-2013
    Location
    Roodepoort, South Africa
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Nested if formula not working as intended

    Awesome

    Thank you so much, was worried that i would have to manually calc of my sheets.


  10. #10
    Valued Forum Contributor
    Join Date
    02-08-2012
    Location
    Newcastle, Australia
    MS-Off Ver
    Excel 2007 and Excel 2010
    Posts
    1,429

    Re: Nested if formula not working as intended

    No worries!

    Please don't forget to mark this thread as solved, and please click on the * next to my post to say thanks

+ 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. Select Case possibly not working as intended. (Another strange bug)
    By 111StepsAhead in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2013, 10:40 AM
  2. [SOLVED] VLOOKUP not working as intended
    By RAS 2112 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2013, 08:58 AM
  3. [SOLVED] SOLVED: Print Macro Not Working As Intended
    By boldcode in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-17-2011, 09:22 AM
  4. Replies: 6
    Last Post: 04-29-2011, 09:11 AM
  5. [SOLVED] macro not working as intended
    By Michael A in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2005, 10:06 PM

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