+ Reply to Thread
Results 1 to 8 of 8

SUMIF with multiple ranges

Hybrid View

  1. #1
    Registered User
    Join Date
    11-09-2012
    Location
    Illinois
    MS-Off Ver
    Excel 2010
    Posts
    26

    SUMIF with multiple ranges

    Good afternoon. I made a mini excel spreadsheet for monitoring gains/losses on a mutual fund. In column B, I have the transaction type, (Purchase, Withdrawl, Dividend). Column C has the dollar amount for each of these transaction type. Is there a way to Sum the dollar amount in Column C if the transaction type is either "Purchase" or "Withrdrawl"?

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

    Re: SUMIF with multiple ranges

    One way...

    =SUM(SUMIF(B:B,{"Purchase","Withdrawl"},C:C))
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Registered User
    Join Date
    11-09-2012
    Location
    Illinois
    MS-Off Ver
    Excel 2010
    Posts
    26

    Re: SUMIF with multiple ranges

    That worked perfectly. Thank you!

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

    Re: SUMIF with multiple ranges

    You're welcome. Thanks for the feedback!

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    53,048

    Re: SUMIF with multiple ranges

    Tony, you never cease to blow me away!! I would have used...
    =SUMIF(B:B,"Purchase",C:C)+SUMIF(B:B,"Withdrawl",C:C)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  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: SUMIF with multiple ranges

    Quote Originally Posted by FDibbins View Post
    Tony, you never cease to blow me away!!
    ----------

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: SUMIF with multiple ranges

    Or this

    =SUMPRODUCT((B:B={"Purchase","Withdrawl"})*(C:C))
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

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

    Re: SUMIF with multiple ranges

    Quote Originally Posted by AlKey View Post
    Or this

    =SUMPRODUCT((B:B={"Purchase","Withdrawl"})*(C:C))
    That's very inefficient.

    You should avoid using entire columns as range references in array formulas and the SUMPRODUCT function.

    A1 = Purchase
    A2 = Withdrawl

    =SUMPRODUCT(SUMIF(B:B,A1:A2,C:C))

    In this application the SUMIF function can efficiently handle the entire column references.

+ 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] AVERAGEIF / SUMIF with multiple ranges
    By xandermacleod in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-13-2012, 01:26 PM
  2. SUMIF over multiple ranges
    By Karroog in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-17-2011, 07:56 PM
  3. SUMIF/AVERAGEIF with multiple ranges
    By Cassi in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 03-04-2011, 11:10 AM
  4. How to SUMIF multiple ranges?
    By karesz in forum Excel General
    Replies: 1
    Last Post: 11-09-2005, 08:35 PM
  5. SumIF Multiple Ranges
    By Erika in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-28-2005, 01:06 PM

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