+ Reply to Thread
Results 1 to 4 of 4

Help with SUMPRODUCT IF type of function

  1. #1
    Registered User
    Join Date
    06-21-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    2

    Help with SUMPRODUCT IF type of function

    I would like to use a formula that accomplishes the following:

    If the values in the row A contain the word "Retail" , then multiply the value in column B with column C and add the results , if not, then 0.

    I would expect the result to be 100 (from row 1) + 25 (from row 3) = 125


    A B C
    Retail store 10 10
    Direct 10 10
    Retail online 5 5
    Last edited by JVAllStar; 06-21-2012 at 01:53 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with SUMPRODUCT IF type of function

    you mean?

    =SUMPRODUCT(--Isnumber(Search("Retail",A1:A100)),B1:B100,C1:C100)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    06-21-2012
    Location
    Minneapolis, MN
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Help with SUMPRODUCT IF type of function

    Yes! Perfect! Thank you!

    Just so I "learn how to fish" instead of you just giving me a fish, what is the point of the --ISNUMBER being added to this formula? Maybe i should ask in 2 seperate questions: why do you add the isnumber, and why do you precede it with --?

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Help with SUMPRODUCT IF type of function

    Firstly, we are searching for "Retail" in the cells, SEARCH() results in a numeric position if the string is found, and #VALUE! error if not found... so we need to find all the cells which SEARCH() resulted in numeric results (positions were determined). All we need to know is if a number was returned (we don't care what number).. so ISNUMBER() checks if SEARCH() returned a numeric result... ISNUMBER() then shows its results as TRUE (if numeric) and FALSE (if not). The -- then coerces the TRUEs and FALSEs to 1s and 0s, respectively, so we can carry on and do the SUMPRODUCT() math. ... now go catch lots of fish

+ 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