+ Reply to Thread
Results 1 to 10 of 10

Gathering the sum of cells based on the text in the adjacent cell

  1. #1
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Gathering the sum of cells based on the text in the adjacent cell

    I have a column of dollar amounts (variances) and next to each is the shift they belong to.

    I am looking to get a break down of the variances for each shift.

    Attached is an example of what it looks like.

    thanks for any help with this formula.

    Nick
    Attached Files Attached Files
    Last edited by avidcat; 01-15-2010 at 04:38 PM.

  2. #2
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Gathering the sum of cells based on the text in the adjacent cell

    In B4, copied down: =SUMIF($B$13:$B$26,$A4,$D$13:$D$26)

    In C4, copied down: =COUNTIF($B$13:$B$26,$A4)
    Palmetto

    Do you know . . . ?

    You can leave feedback and add to the reputation of all who contributed a helpful response to your solution by clicking the star icon located at the left in one of their post in this thread.

  3. #3
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Gathering the sum of cells based on the text in the adjacent cell

    Very cool, thanks Palmetto.

    I have the Net total and number of variances working now, do you know how to get my other column to add the absolute (ABS) totals for each?

    thanks,
    Nick

  4. #4
    Forum Expert Palmetto's Avatar
    Join Date
    04-04-2007
    Location
    South Eastern, USA
    MS-Off Ver
    XP, 2007, 2010
    Posts
    3,978

    Re: Gathering the sum of cells based on the text in the adjacent cell

    For Excel 2007:

    =SUMIFS($D$13:$D$26,$B$13:$B$26,A4,$D$13:$D$26,">0")+ABS(SUMIFS($D$13:$D$26,$B$13:$B$26,A4,$D$13:$D$26,"<0"))


    Pre-2007
    =SUMPRODUCT(--($B$13:$B$26=A4),--($D$13:$D$26>0),($D$13:$D$26))+ABS(SUMPRODUCT(--($B$13:$B$26=A4),--($D$13:$D$26<0),($D$13:$D$26)))

  5. #5
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Gathering the sum of cells based on the text in the adjacent cell

    Thanks, worked perfect.

    Nick

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Gathering the sum of cells based on the text in the adjacent cell

    Assuming A4:A6 just contains "Day", "Swing" or "Grave" then you can use this formula for the ABS value

    =SUMPRODUCT(($B$13:$B$26=A4)*ABS(D$13:D$26))

  7. #7
    Forum Contributor
    Join Date
    12-15-2005
    MS-Off Ver
    Office 2007
    Posts
    346

    Re: Gathering the sum of cells based on the text in the adjacent cell

    Thanks daddylonglegs.

  8. #8
    Registered User
    Join Date
    02-02-2014
    Location
    Benicia, California
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Gathering the sum of cells based on the text in the adjacent cell

    I'm a little slow to join this party, but both the question and the responses have proven very helpful to me this morning!



    Thanks!

    -julia

  9. #9
    Registered User
    Join Date
    02-19-2014
    Location
    Toronto
    MS-Off Ver
    2010
    Posts
    4

    Re: Gathering the sum of cells based on the text in the adjacent cell

    what if i have multiple columns? see attached

    need to add data from b2:b12,d2:d12,f2:12,h2:h12 and show totals in L2:L7

  10. #10
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,446

    Re: Gathering the sum of cells based on the text in the adjacent cell

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

+ 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