+ Reply to Thread
Results 1 to 3 of 3

Totaling multiple columns

  1. #1
    Valued Forum Contributor
    Join Date
    11-20-2003
    MS-Off Ver
    2010, 2016
    Posts
    1,174

    Totaling multiple columns

    I have a spreadsheet that contains about 3000 rows of data. For each row, I need to calculate a total quantity amount for each unique account number.

    The way I need the spreadsheet to calculate totals is: if all values in columns A, F, G, H in row 3 are all equal to same columns in row 2, then total the value in column E for rows 2 & 3. I can write a formula for this, but the problem I am running into is if there are more that 2 rows involved.

    Please see attached spreadsheet for what spreadsheet should look like. All the calculations are to take place in column J.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,527
    Hi there,

    I don't think you can do this in one column, but have a look at the attached where I've created two columns (I've hidden them so the overall look stays the same) to calculate a running total of each category (Column J) and then display that total on the last line of the category (Column K). Column L then shows the results from Column K if the figure in Column K is not zero.

    This is based on the assumption that the data is sorted in the same way you have attached the original workbook.

    HTH

    Robert
    Attached Files Attached Files

  3. #3
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591
    HI

    J2: array enter (ctrl, shift, enter)
    =IF(ROW()=MAX(($A$2:$A$24=A2)*($F$2:$F$24=F2)*($G$2:$G$24=G2)*($H$2:$H$24=H2)*ROW($E$2:$E$24)),SUMPRODUCT(--($A$2:$A$24=A2),--($F$2:$F$24=F2),--($G$2:$G$24=G2),--($H$2:$H$24=H2),($E$2:$E$24)),"")

    You will have to adjust the ranges as required.

    Copy down to suit.

    HTH

    rylo

+ 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