+ Reply to Thread
Results 1 to 6 of 6

Function recognizes two columns and adds total of two other columns

  1. #1
    Registered User
    Join Date
    01-08-2007
    Posts
    35

    Function recognizes two columns and adds total of two other columns

    I currently have a function that I have been using for awhile that recognizes words in column A (Keywords) and once it matches up these exact words, will then add the sum of columns C (Clicks) and Column D (cost) together for each individual word.

    The function looks like this for column C: =SUMPRODUCT(--(A$2:A$1489=A2)*(C$2:C$1489))

    and this for Column D: =SUMPRODUCT(--(A$2:A$1489=A2)*(D$2:D$1489))


    BUT now I need the function to recognize two columns, instead of one. Column A (Keywords) and Column B (Match Type) and give me the total Clicks and Total Costs for each one.

    So basically, the function must have a match for a word in column A and a word for Column B. Once there is a match on BOTH columns, then the function can add the sum of Column C (Clicks) and Column D (Cost) for that particular keyword/match type.

    Should be able to take the function provided above and just add one more function type to it, but I don't know enough on functions to do this. Please help.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482
    here is an great example on sumproduct
    http://www.xldynamic.com/source/xld.SUMPRODUCT.html

  3. #3
    Registered User
    Join Date
    01-08-2007
    Posts
    35
    ok...thanks for the page, but this is a very long page and I am not an excel master so some of it is quite foreign to me. Can you point at which section pertains to my query or just simply send me the function?

    Thank you.

  4. #4
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    Hi

    1) On the link the second last formula in the Evolving Use of Sumproduct refers [=SUMPRODUCT((A1:A10="Ford")*(B1:B10="June")*(C1:C10))]

    2) Your first formula above would be changed to
    column C: =SUMPRODUCT(--(A$2:A$1489=A2),--(B$2:B$1489=B2),(C$2:C$1489))


    rylo

  5. #5
    Registered User
    Join Date
    01-08-2007
    Posts
    35
    Thank you VERY much Rylo for your help. That is just what the doctor ordered!

  6. #6
    Valued Forum Contributor
    Join Date
    07-16-2007
    Location
    GA
    MS-Off Ver
    Office 365 - Version 2403
    Posts
    1,054

    Extract Key Word & Add

    Hi


    The following formula works well for me:

    =SUMIF($O$6:$O$65,"Toll*",$P$6:$P$65)

    I have 2 columns.

    1st column a brief expense type

    2nd column is the actual expense or costs.

    In this example, the formula looks for the word, "Toll", then finds the value in the next column & will add all instances to give a total.

    Hope that helps


    Quote Originally Posted by grafx77
    I currently have a function that I have been using for awhile that recognizes words in column A (Keywords) and once it matches up these exact words, will then add the sum of columns C (Clicks) and Column D (cost) together for each individual word.

    The function looks like this for column C: =SUMPRODUCT(--(A$2:A$1489=A2)*(C$2:C$1489))

    and this for Column D: =SUMPRODUCT(--(A$2:A$1489=A2)*(D$2:D$1489))


    BUT now I need the function to recognize two columns, instead of one. Column A (Keywords) and Column B (Match Type) and give me the total Clicks and Total Costs for each one.

    So basically, the function must have a match for a word in column A and a word for Column B. Once there is a match on BOTH columns, then the function can add the sum of Column C (Clicks) and Column D (Cost) for that particular keyword/match type.

    Should be able to take the function provided above and just add one more function type to it, but I don't know enough on functions to do this. Please help.
    MyCon
    -- Using Latest Version of Excel

+ 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