+ Reply to Thread
Results 1 to 11 of 11

Is there a way to simplify this calculation?

  1. #1
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Is there a way to simplify this calculation?

    I have inherited a spreadsheet covered in calculations like the below that seem to just repeat themselves. I have gone over this and cut out points I think can go but it simply breaks the calculations.

    Any ideas?

    =IF(ISERROR(IF(H22="","INCOMPLETE",(SUM((COUNTIF(H22:H22,"No")*(5%/(1-(COUNTIF(H22:H22,"N/A"))))))))),5%, IF(H22="","INCOMPLETE",(SUM((COUNTIF(H22:H22,"No")*(5%/(1-(COUNTIF(H22:H22,"N/A")))))))))

  2. #2
    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,683

    Re: Is there a way to simplify this calculation?

    Well, you can lose a lot of the brackets for a start:

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    But, it's an old style error check using ISERROR and repeating the formula.

    If you are using Excel 2007 or above, you can use IFERROR instead. The error value here is 5%.

    So, it becomes:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Which is a little shorter and clearer.


    Regards, TMS
    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


  3. #3
    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,683

    Re: Is there a way to simplify this calculation?

    That said, it actually looks as though it should be an Array Formula for a bigger range than just H22.

    You can look at the component parts:

    HTML Code: 

    HTML Code: 

    Note that the literal "N/A" is not the same as the error code generated by a formula error (or by using =NA())


    HTML Code: 

    Regards, TMS

  4. #4
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is there a way to simplify this calculation?

    Thanks TMS,

    I used the the second shorter suggestion in your first post.

    Regarding your second post, each point in the sheet is worth different values depending on answer provided. So I'm not sure how the HTML suggestion would work.

  5. #5
    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,683

    Re: Is there a way to simplify this calculation?

    Forget the second post. I was just working through each of the components to see what values they, individually, returned. No matter.

    I don't know what the sheet/data looks like so I cannot offer an informed opinion but it feels as though much of the formula (even the new short version) is redundant.

    However ...


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


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    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


    You may also want to consider thanking those people who helped you by clicking on the little star at the bottom left of their reply to your question.

  6. #6
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is there a way to simplify this calculation?

    Thank you TMS and I have used the star to thank you for your assistance. I will also mark as solved.

    I would have shown or attached a copy for reference however due to legal compliance reasons I am unable to do so, but again thank you very much for your assistance.

  7. #7
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is there a way to simplify this calculation?

    The basic of the sheet is multiple questions with a Yes, No or N/A marked againest them. If is marked as a Yes or N/A it is worth a certain percentage of 100% if it is marked as no, it worth nothing. LOADS of if statements similar to above...

  8. #8
    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,683

    Re: Is there a way to simplify this calculation?

    Shame you can't mock up a sample. But, I'm sure it will be better than it was.

    Thanks for the rep.

  9. #9
    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,683

    Re: Is there a way to simplify this calculation?

    Surely the formula could just be something like:

    Formula: copy to clipboard
    Please Login or Register  to view this content.



    Regards, TMS

  10. #10
    Registered User
    Join Date
    11-27-2013
    Location
    Leeds, England
    MS-Off Ver
    Excel 2010
    Posts
    41

    Re: Is there a way to simplify this calculation?

    TMS,

    I've stripped a massive chuck of the system out and attached a bare bones copy of the sheet I am working on. Let me know what you think or if you can see a way to improve.

    Submit transfers in to "database" tab, clear, clears and spell check turns the password protect off, spell checks and then turns the password back on. All calculations fields are locked and can't be selected when the protect is turned on. Password is currently turned off but will turn on if you press spell check, write it down from the macro...

    Thanks again buddy,
    Attached Files Attached Files

  11. #11
    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,683

    Re: Is there a way to simplify this calculation?

    I've put this code into the empty Module4:

    Please Login or Register  to view this content.

    I've also shortened the code in Module 6 to this:

    Please Login or Register  to view this content.

    I have set up a Static Named Range containing the percentages on the Formulae sheet. This allows me to use this formula in the majority of the cells:

    H7:
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    but note that one formula is different, hence the code above.

    Separating the percentages out means you can more easily adjust the percentages applied to each of the questions ... and the formulae are consistent.

    Anyway, see the updated sample. Unless I am much mistaken, the alternative formulae produce the same results as the shortened replacements for the original formulae. It's easy to swap between the two using the subroutines listed above.

    Regards, TMS
    Attached Files Attached Files

+ 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. Simplify XIIR Calculation in Excel
    By [email protected] in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 01-28-2013, 02:30 AM
  2. possible to simplify?
    By xLiquidFlames in forum Excel General
    Replies: 1
    Last Post: 02-23-2009, 03:29 AM
  3. Simplify and add to IF
    By Mark K in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-24-2006, 06:13 AM
  4. Simplify
    By ccl28 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-15-2006, 05:50 AM
  5. A way to simplify this please
    By Larry Empey in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2006, 08:10 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