+ Reply to Thread
Results 1 to 7 of 7

Make this formula more efficient? If statements/etc.

  1. #1
    Registered User
    Join Date
    12-18-2015
    Location
    US
    MS-Off Ver
    2010
    Posts
    8

    Make this formula more efficient? If statements/etc.

    Hello, and help!


    This is the logic to follow. There are initial test scores and follow up test scores. Initial test scores count if they are the only test score. If there are both initial and follow up test scores, then the follow up test score should be chosen. Occasionally, there is a score and it is not known if this was an initial or follow up test. (unknown) In that case, if that score is higher, it should be chosen, but somehow marked/highlighted for confirmation of which type it is.

    Two people came up with 2 formulas. The first one is short, sweet, but ignores the 'unknown' column and gives it a default value of "0".
    The second one works the same, but does not ignore the unknown column and does seem to choose the correct response, but it is very long and I think it is doing the right thing, but since I can't really 'read the long formula' I am not sure!

    Examples:

    I-test = 50 F-test= 40 (choose 40)
    I-test =50 F-test = blank (there was no F-test) Choose 50
    I-test = 50 F-test=blank, U-test=60 Choose Highest (60), but review U-test to determine if should be initial test or follow up test. (this would have to be done individually, I think).


    The formula being used in column F is as follows: =IF(OR(C2="",C2=0),B2,C2)
    The one in Column G is: =IF(AND(C2<>0,NOT(ISBLANK(C2))),C2,IF(AND(C2=0,B2>=D2),B2,IF(AND(ISBLANK(C2),B2>=D2),B2, IF(AND(C2=0,B2< D2),D2, IF(AND(ISBLANK(C2),B2< D2),D2, IF(AND(ISBLANK(B2), ISBLANK(C2)), D2))))))

    So, I am asking
    1. Is there a better/shorter formula like the one used in Column G
    2. Does the one that is there follow the logic and how can you add an element to highlight or somehow call attention to one that is based on the highest unknown test type?

    Sorry if my explanations are lacking.
    Attached Images Attached Images

  2. #2
    Forum Expert dflak's Avatar
    Join Date
    11-24-2015
    Location
    North Carolina
    MS-Off Ver
    365
    Posts
    7,920

    Re: Make this formula more efficient? If statements/etc.

    It would help a lot if you include a sample spreadsheet so we don't have to create one from scratch.

  3. #3
    Registered User
    Join Date
    12-18-2015
    Location
    US
    MS-Off Ver
    2010
    Posts
    8

    Re: Make this formula more efficient? If statements/etc.

    Ok, see below?
    Attached Files Attached Files

  4. #4
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Make this formula more efficient? If statements/etc.

    For that "Max Value" column, if that is supposed to show the largest score, then:-
    In E2: =MAX(B2:D2)
    For F2: =IF(C2>0,C2,B2)
    For G2: =IF(D2>0,MAX(B2:D2),0)

    I also added a Combined column. It includes both formulas in the one. It replaces columns F & G.

    Conditional formatting shows matches to the choice in the combined column....But it will highlite duplicate numbers, as in 2 tests both having the chosen score.
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Make this formula more efficient? If statements/etc.

    I added another column to act as a written confirmation of choice.
    Should be more accurate then the highlighting.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    12-18-2015
    Location
    US
    MS-Off Ver
    2010
    Posts
    8

    Re: Make this formula more efficient? If statements/etc.

    Excel Testing Part 3.xlsx

    Thanks so much Beamernsw

    I don't know if I 'broke' the one you supplied or if it isn't working on some of them as expected. See the attachment.

    (Also, I probably didn't explain it well enough, either)

  7. #7
    Valued Forum Contributor
    Join Date
    12-28-2014
    Location
    NSW, Australia
    MS-Off Ver
    MS365
    Posts
    604

    Re: Make this formula more efficient? If statements/etc.

    Ok, sent pm's....finally

+ 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. Make VBA Macro more efficient
    By boubou114 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-18-2015, 10:32 AM
  2. Replies: 2
    Last Post: 08-12-2014, 12:56 PM
  3. [SOLVED] Make large chunk of If statements efficient. Array maybe?
    By mdovey in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-20-2014, 11:32 AM
  4. Replies: 7
    Last Post: 03-25-2011, 02:44 PM
  5. How to make VBA code more efficient?
    By globulous in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-14-2010, 12:02 PM
  6. How to make my formula more efficient
    By yuzi in forum Excel General
    Replies: 7
    Last Post: 05-29-2009, 05:54 PM
  7. How can I make this code more efficient?
    By Sethaholic in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-01-2006, 12:20 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