+ Reply to Thread
Results 1 to 7 of 7

How to analyze multiple conditions in a row, return an answer in the same row, new column

  1. #1
    Registered User
    Join Date
    07-04-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    4

    How to analyze multiple conditions in a row, return an answer in the same row, new column

    I'm trying to analyze multiple cells in any row of data, have a look-up of either a value based on a term in the same row, and return a value (either a flat amount, or sometimes needing a computation) in the same row in a new column.

    For example, each person has multiple tasks to perform, and can be paid a commission based on the task definition, but each defined task pays a different commission.

    The logic in this example is in column D, with results placed in column E.

    Grid3.JPG

    My challenge is there are up to 40 different people with multiple commission rates based on up to a half dozen tasks, so each line can yield a completely different commission computation. I'm pretty good at using nested if statements, but I suspect something this complex will need more knowledge that I currently have! I don't know how to attack this as there seems to be far too many variables then simple if statements or something similar can compute. I'm looking for anyone who can point me in the right direction. If i can understand how to build something for just one person, I need to be able to do the same adding multiple people and multiple computational variable.

    Thanks in advance for any assistance.

    Bruce
    Attached Images Attached Images

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    What are the rules governing who is paid what?

    Can you post a file with clear explanation of the rules (logic) for assigning commission.

    Problem suggests one or more Table "lookups".

  3. #3
    Registered User
    Join Date
    07-04-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    4

    Smile Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    Hi John,

    I appreciate your asking for the rules governing the payments. The Attachment to my reply has one such table already constructed (and I put an image of the key logic used in the table, below so others can see an example of what it is). For the task name across the top of the chart, below in those columns are the payment amounts for the people on the left. All are "flat dollar amounts" as seen, so no computation is needed - those values simply need to be returned to the main worksheet. The only column with a real computation is column H labeled "Appraisal", and the commission percentages in that column would be applied against the dollar amount to compute the needed result.

    For simplicity sake, the only detail I do not show is another half dozen or so task descriptions (column H), but I haven't listed them (except "Appraisal"), because they all would have the same commission percentage applied, regardless of their name.

    I made a few attempts at nesting "And", or "Or" in If statements, I've tried using "Sumif" with a "vlookup", but each cell would need such a huge string of nested items, it would be way too difficult to edit as new people and commissions are added. So, yes, I think your looking to a table or table would be the way to go, and hopefully this reply gives you enough to fully understand the logic involved and for you to attempt a solution. I REALLY appreciate your taking the time to help!

    Bruce

    Grid4.JPG
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    Have look at the attached:

    I have used the following as a basic calculation:

    =SUMPRODUCT((Sheet1!$D$4:$D$38=$A6)*(Sheet1!$E$4:$G$38)*(Sheet1!$E$3:$G$3=$B6))+SUMPRODUCT((Sheet1!$D$4:$D$38=$A6)*((Sheet1!$H$3:$H$3=$B6)*(Sheet1!$E$4:$H$38)*$C6))

    I have effectively combined two lookups: one for the flat rate commission (first SUMPRODUCT) and "added" the "appraisal" % calculation ( second SUMPRODUCT): it will be one or the other

    Alternatives could include testing if it as an "Appraisal" and separating the calculations:

    =IF (Appraisal, SUMPRODUCT #2, SUMPRODUCT #1)

    In the above SUMPRODUCT #2 could be replaced with a VLOOKUP

    =VLOOKUP(A6,Sheet1!D4:H38,5,0)*C6
    Attached Files Attached Files
    Last edited by JohnTopley; 09-05-2015 at 11:34 AM.

  5. #5
    Registered User
    Join Date
    07-04-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    4

    Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    Very nice approach - let me work on it and I'll keep you posted on progress. Thanks again, I'll post results asap...

    Update 9/7/15 - Your approach helped me find a solution and thanks. What I ended up doing is removed some of the possible commission descriptors because all of the ones that had actual computations involved (as opposed to a set dollar amount for some of the tasks), had the same commission percentage for each subcontractor. I just took any task with computations, and created one term (Computation) that covers all the possible task description. This made the task easy - I only have to match 3 unique task names, and with that done, I used a combination nested IF statements using AND and VLOOKUPs. While it is still not "economical" as to a lengthy "IF" statement, it can be edited when a new person is added - still plenty of room for more IF factors and the comps came out perfectly...THANKS for the needed logic to help me solve this!

    Here is the formula: Commission Formula.JPG
    Last edited by bhaines; 09-07-2015 at 09:26 AM.

  6. #6
    Registered User
    Join Date
    07-04-2012
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007, 2010
    Posts
    4

    Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    John,

    A personal thanks for the help in logic - I didn't use your exact thoughts, but I did end up going to a vlookup solution with some changes in how I was trying to track commissions. In any event, I have what my final result is in the edited post...thanks again...

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,169

    Re: How to analyze multiple conditions in a row, return an answer in the same row, new col

    I would not like the responsibility of maintaining your IF statement!

    Looking at the statement your AND statements are the wrong construct...

    =IF(AND(condition1,condition2 ,,,,,,,),TRUE result, FALSE result)

    NOT

    =IF(AND(condition1,AND(condition2 )),TRUE result, FALSE result)

    I am sure the statements can be improved: hard coding names does not appear a good approach.

+ 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] Comparing multiple value to return an answer
    By bertique in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-20-2015, 12:48 AM
  2. [SOLVED] Return an answer from a column; using an array and a single row ...
    By wesrockin in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 06-28-2013, 03:21 AM
  3. [SOLVED] Simple formula to match column A, sheet1, with column A, sheet2, return text answer
    By Connie5761 in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 11-14-2012, 02:56 PM
  4. [SOLVED] Return column header by comparing multiple row values conditions
    By aschom in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 09-06-2012, 08:52 PM
  5. Replies: 9
    Last Post: 11-24-2011, 01:56 PM
  6. [SOLVED] Lookup Multiple Criteria return One answer
    By cbanks in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-26-2006, 04:10 PM

Tags for this Thread

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