+ Reply to Thread
Results 1 to 8 of 8

Calculation based on multiple conditions

  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.

  2. #2
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Calculation based on multiple conditions

    Hi jorjacman,

    What do you mean by 'picked'?

    Do you mean someone has 'selected' one Cell value & then another?
    Remember you are unique, like everyone else

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

    Re: Calculation based on multiple conditions

    The pick 1 and pick 2 are manually entered. Someone has "picked" which category they are using.

  4. #4
    Forum Contributor noboffinme's Avatar
    Join Date
    08-29-2013
    Location
    Melbourne, Australia
    MS-Off Ver
    Excel 2003/7/10/13/16/19
    Posts
    1,071

    Re: Calculation based on multiple conditions

    So they are manually entering a letter into the Columns 'F' & 'G'?

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

    Re: Calculation based on multiple conditions

    Correct =)

  6. #6
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Calculation based on multiple conditions

    This should do what you want. I also think that there are a few errors in the sample given
    Attached Files Attached Files
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

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

    Re: Calculation based on multiple conditions

    Works seamlessly, thank you!

  8. #8
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Calculation based on multiple conditions

    Thank you for the feedback on your problem.

+ 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. [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