+ Reply to Thread
Results 1 to 4 of 4

equate Text values to numbers for addition.

  1. #1
    all4excel
    Guest

    equate Text values to numbers for addition.

    There are three values in the Dropdown a
    1) Default blank value. (Always a "0")
    2) Yes. (Depending on selction under which column)
    3) No. (Always a "0")
    --------------------------------------------------------------------------------
    If "Yes" is selected under Old Navy exclusively then the answer in total should be 26,

    If "Yes" is selected under Old Navy and (Ross or TJX) then the answer in total should be 26 +8,

    If "Yes" is selected under Old Navy and (Ross & TJX) then the answer in total should be 26+8+8,

    If "Yes" is selected under Old Navy and (Target or Walmart) then the answer in total should be 26+4+4,

    If "Yes" is selected under Old Navy and (Target & Walmart) then the answer in total should be 26+8+8,

    There are different probabilities depending on the selction of "Yes" and the answer in the Total should reflect and add only to that...

    Hope I have been able to expalin well with the call-outs..

    Thanx in anticipation..

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Want to equate Text values to numbers for addition.

    See if this example does what you want...

    Please Login or Register  to view this content.
    Is that something you can work with?
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678
    Unsure of the OP's intent, but that doesn't work for
    If "Yes" is selected under Old Navy and (Target & Walmart) then the answer in total should be 26+8+8,

  4. #4
    all4excel
    Guest

    Smile Excellent---That was so quick and compact...

    Quote Originally Posted by Ron Coderre
    See if this example does what you want...

    Please Login or Register  to view this content.
    Is that something you can work with?

    Excellent..! You are my man...Ron Coddere


    Can u please explain the code...I have attached the file for others who also can make use of this excellent piece of code....

    SUMPRODUCT is really a unique funtion but have not absorbed it so well to use it too often...

    If u have any good examples of when it can be used it would be wonderful to have a look...

    Thanx once again..
    Last edited by all4excel; 12-06-2007 at 02:44 PM.

  5. #5
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    SUMPRODUCT function

    Wow! I hardly know where to begin. I devote an hour to SUMPRODUCT in
    the "Excel for Financial Analysts" class I teach...and it usually runs into
    overtime. Why? Because SUMPRODUCT is Excel's "duct tape" function....it
    works when practically nothing else will.

    First, see SUMPRODUCT in Excel Help.

    Basically, that function multiplies two or more same sized ranges
    ...then, sums the resulting products.

    Example:
    A1:B3 contains these values
    4 7
    5 8
    6 9

    If you wanted to multiply Col_A x Col_B, you'd get:
    4 7 =28
    5 8 =40
    6 9 =54

    The sum of those products is: 122

    The SUMPRODUCT function, in this form, does exactly that:
    =SUMPRODUCT(A1:A3,B1:B3)
    =122

    It also works in this form:
    =SUMPRODUCT((A1:A3)*(B1:B3))
    =122

    Now, here's the fun part....You can put Boolean Expressions (fancy term for
    TRUE/FALSE expressions) in the function to apply criteria to what's actually
    added.

    For instance, if we only wanted to add Col_B items where the corresponding
    Col_A item is greater than 4...we could use this 2nd form of the function:
    =SUMPRODUCT((A1:A3>4)*(B1:B3))

    Each comparison of A1:A3 to 4 results in TRUE or FALSE.
    Which Excel converts to 1 and 0, respectively, when multiplying.

    So the source ranges become:
    0 7 =0
    1 8 =8
    1 9 =9

    And the SUMPRODUCT is: 17....(0x7+1x8+1x9)

    For more information about SUMPRODUCT than you'd ever want to know
    ...see this link:
    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

    I hope that helps.

  6. #6
    all4excel
    Guest

    Question Thanx a lot

    Thanx a lot Ron Coddere I wish I cud attend one of your valuable classes..

    Its not that i dont know SUMPRODUCT at all but i dont know what all it can do..because of its varied uses.

    As hardly is mentioned in MS Excel help, you really cannot think it to be as an alternative to beat other functions as its not well-propagated.
    Last edited by all4excel; 12-07-2007 at 02:50 PM.

  7. #7
    all4excel
    Guest

    Lightbulb Slight twist in the requirement..

    Was really not sure whether to start a new thread or not?

    I got the answer RON by using SUMPRODUCT.

    However, in the earlier case there were three options
    1. BLANK - SCORE -0
    2. YES - SCORE - DEPENDING ON THE STORE.
    3. NO- SCORE-0

    Now , I have the stores which have been given "A","B","C","D" AND "E" for different parameters.

    The point allocations is as follows:
    A B C D E
    10 8 6 4 2

    Ex:
    Sr.No Store Name Old Navy Ross TJX Target Walmart Total
    1 abc A B C D A 28

    Now these options are in the form of a drop-down, when i select "A" then the total should reflect 10 which is happening however when I select any alpahabet more than once it adds the score only once.

    formula [ =SUMPRODUCT(($C2:$G2=$K$1:$O$2)*$K$2:$O$2) ]

    $K$1:$O$2 -- contains the list..
    A B C D E
    10 8 6 4 2

    can u suggest a solution?
    Last edited by all4excel; 12-08-2007 at 11:58 AM.

  8. #8
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    equate Text values to numbers for addition.

    Try this

    Please Login or Register  to view this content.
    I hope that helps.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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