+ Reply to Thread
Results 1 to 6 of 6

Sumproduct with multiple criteria and ignoring text values

  1. #1
    Registered User
    Join Date
    03-12-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    4

    Sumproduct with multiple criteria and ignoring text values

    Hello all, I've looked through a number of posts but am still having an issue.

    Using Excel 2010, I am trying to do a Sumproduct formula with two criteria, one of which needs to ignore text values. Here is the set up:

    Column A Column B Column C
    (Side) (Qty) (Price)
    Buy 5,512 15.67
    Sell 119,428 null
    Buy 24,209 45.77
    Sell 20,054 12.25
    ...

    I'm trying to find the sumproduct of Qty * Price if the side equals "Buy" (or "Sell") but ignoring the "null" value in column C. The formula I have is =SUMPRODUCT(--($A$2:$A$20="Buy")*IF(ISNUMBER($C$2:$C$20),--($B$2:$B$20*$C$2:$C$20)))

    The result in the cell is 0, but if I open the Insert Function dialog box, I see the correct value being returned. Does anyone know why this may be, or have a different way of going about this?

    Thanks for the help!

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct with multiple criteria and ignoring text values

    Try

    =SUMPRODUCT(--($A$2:$A$20="Buy"),$B$2:$B$20,$C$2:$C$20)

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumproduct with multiple criteria and ignoring text values

    Maybe this...

    =SUMPRODUCT(--ISNUMBER(MATCH(A2:A5,{"Buy","Sell"},0)),B2:B5,C2:C5)
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Registered User
    Join Date
    03-12-2012
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Sumproduct with multiple criteria and ignoring text values

    Thanks Jonmo and Tony for the quick responses! I had more luck with Jonmo's, but I'll play around with the Match formula to see if I can get it another way.

    Much appreciated!

  5. #5
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Sumproduct with multiple criteria and ignoring text values

    Quote Originally Posted by soapy View Post
    Thanks Jonmo and Tony for the quick responses
    You're welcome.

    Quote Originally Posted by soapy View Post
    Price if the side equals "Buy" (or "Sell")
    That was a bit confusing the way you wrote that.
    I think Tony interpraited that to mean you wanted to count both Buy and Sell in a single formula
    But I think you meant you intended to have 2 seperate formulas, one for Buy and one for Sell

  6. #6
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Sumproduct with multiple criteria and ignoring text values

    I may have misunderstood what you wanted.

    I interpreted this...

    if the side equals "Buy" (or "Sell")
    ...to be a multiple condition where it looks like you want 1 formula for Buy and another formula for Sell.

    In that case Jonmo's suggestion is the way to go.

+ 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] Conditional formatting multiple number values but IGNORING text.
    By Dazmeister in forum Excel General
    Replies: 14
    Last Post: 09-06-2013, 09:02 AM
  2. [SOLVED] Find minimum (ignoring blank cell or zero values) with Multiple Criteria
    By Joeywei in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-27-2013, 08:45 PM
  3. [SOLVED] Summation of values based on multiple criteria & ignoring blanks
    By coreyjo in forum Excel General
    Replies: 6
    Last Post: 04-18-2012, 04:16 PM
  4. SUMPRODUCT with multiple values for criteria?
    By tangcla in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 07-27-2009, 05:27 AM
  5. [SOLVED] Sumproduct with multiple text criteria
    By Robert in forum Excel General
    Replies: 2
    Last Post: 12-06-2005, 01:45 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