Results 1 to 8 of 8

Calculation based on multiple conditions

Threaded View

  1. #1
    Registered User
    Join Date
    12-16-2013
    Location
    Florida
    MS-Off Ver
    Excel 2010
    Posts
    41

    Calculation based on multiple conditions

    Hello,

    Attached is a spreadsheet to further illustrate my description of the problem.

    Sample2.xlsx


    There are 4 categories (a,b,c,d) and each category has its own set of theoretical values. I want to find the difference between what is picked and what the actual value is. However, if two values are picked, the difference is the actual minus the average of those two picked values.

    Trial #1 : b and c are picked. therefore, the difference is actual minus the average of b and c ==> 12 - (12+15)/2 = -1.5
    Trial #2: only b is picked therefore the difference is simply actual minus the value of b at that point ==> 13 - 13 = 0
    Trial #3: c and c are picked. this is not possible in the experiment thus I wrote "Error" into the formula if this occurs.
    Trial #4: c and b are picked. this is the swap of b and c but should still work ==> 15 - (15+21)/2 = -3
    Trial #5: the first pick is skipped and the second pick is b. this is not possible in the experiment thus I wrote "Error" into the formula if this occurs.

    Each trial # corresponds to a certain condition with a specific outcome that I desire. The formula WORKS! However, it is not very elegant and is difficult to modify if necessary (add categories e,f,g,etc). Is there a way to simplify the formula and also make it flexible?

    Basically I'm trying to achieve the following:

    1. If a pick 1 exists and a pick 2 exists and they are different, calculate difference equivalent to actual minus the average of those picks.
    2. If pick 1 exists but pick 2 does not, calculate difference equivalent to actual minus the value of pick 1.
    3. For all else, return "ERROR"



    Let me know if you need any further elaboration and thanks in advance!
    Last edited by jorjacman; 12-30-2013 at 12:24 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Need calculation based on 2 conditions
    By kguenzel in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-14-2012, 11:43 AM
  2. [SOLVED] Calculation Based upon a number of conditions.
    By halfpint123 in forum Excel General
    Replies: 5
    Last Post: 08-28-2012, 09:59 AM
  3. calculation using reference to cells based on conditions
    By shrimic in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-16-2012, 12:32 PM
  4. Indemnity Calculation based on the conditions
    By nawas in forum Excel General
    Replies: 2
    Last Post: 04-29-2011, 02:03 PM
  5. Use different formula to calculation based on conditions
    By 0-0 Wai Wai ^-^ in forum Excel General
    Replies: 2
    Last Post: 12-03-2005, 04:30 AM

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