+ Reply to Thread
Results 1 to 5 of 5

Summing one column if next row contains a text string

Hybrid View

  1. #1
    Registered User
    Join Date
    10-26-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Summing one column if next row contains a text string

    Hi,

    I need help with a formula. I have two columns in a spreadsheet, which is laid out for example as follows (Not the actual spreadsheet) -

    Column 1 Column 2
    Action Taken Cost

    Paid $12.99
    Not Paid $0.00
    Refunded $19.00
    Not Paid $0.00
    Paid $20.00
    Refunded $9.00

    I need to create a formula that will update dynamically for the total amount that was "Refunded". If column 1 says "Refunded", I want to add the totals of those values in column 2 that are in the next cell.

    For example, the total refunded would be $28.00 as above. The spreadsheet does need to be laid out like above.

    Thank you for your help.

  2. #2
    Valued Forum Contributor tlafferty's Avatar
    Join Date
    04-08-2011
    Location
    United States, Tacoma, WA
    MS-Off Ver
    Excel 2010, Excel 2013 Customer Preview
    Posts
    1,112

    Re: Summing one column if next row contains a text string

    Assuming your labels refunded, paid etc are in column A and values to sum are in column b
    =SUMIF(A:A,"=Refunded",B:B)
    If your question has been satisfactorily addressed, please consider marking it solved. Click the Thread Tools dropdown and select Mark thread as solved.
    Also, you might want to add to the user's reputation by clicking the star icon in the lower left corner of the post with the answer- it's why we do what we do...

    Thomas Lafferty
    Analyst/Programmer

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Summing one column if next row contains a text string

    @Tom:

    =SUMIF(A:A,"=Refunded",B:B) ... ?

    Or just:

    =SUMIF(A:A,"Refunded",B:B)


    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    10-26-2011
    Location
    New York, NY
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Summing one column if next row contains a text string

    Thanks guys, it works!

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,290

    Re: Summing one column if next row contains a text string

    You're welcome. Thanks for the rep.

    If this has answered your question, please mark your thread as solved.

    Regards

+ 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