+ Reply to Thread
Results 1 to 7 of 7

Sum Data in Multiple Columns

  1. #1
    Registered User
    Join Date
    12-08-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    3

    Sum Data in Multiple Columns

    I have an excel sheet with about 250 columns worth of data (A:IQ). Column A contains a unique value/header (9025 rows), and then each column (B:IQ) contains data associated with/for that value. This data is a combination of a year with a dollar amount for that year in the immediate column to the right. A single value from column A may have the same year in multiple columns, with different corresponding dollar amounts (a single column does not contain the same year all the way down).

    I would like to perform a calculation that adds up the dollar value associated each year in the column to the left of the dollar value, so that for each row, I have a single dollar amount for each year. Since I am reading across the row, I know I can’t use a sumif function. At this point, I am at a loss of how to get this calculation. Sample data and the ideal results are below. Any thoughts/guidance are sincerely appreciated.


    Example:
    Source File
    Title (A) Year (B) Amount (C) Year (D) Amount Year(F) Amount(G)
    NAME 1 2011 100 2011 125 2013 50
    NAME 2 2011 50 2012 50 2012 100
    NAME 3 2012 100 2013 25 2013 100

    Desired Result:
    Title(A) 2011(B) 2012(C) 2013(D) 2014(E) 2015(F)
    NAME 1 225 0 0 0 0
    NAME 2 50 150 0 0 0
    NAME 3 0 100 125 0 0

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Sum Data in Multiple Columns

    Nobody would want to type that data into an Excel sheet before being able to try different things out, so it would help if you attached a sample Excel workbook.

    To do this, click on Go Advanced (below the Edit Window) while you are composing a reply, then scroll down to and click on Manage Attachments and the Upload window will open. Click on Browse and navigate to (and double-click) the file icon that you want to attach, then click on Upload and Close this Window to return to the Edit window. When you have finished composing your post, click on Submit Post.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    12-08-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    3

    Re: Sum Data in Multiple Columns

    Thanks for the suggestion, Pete. I really appreciate your help.

    Here is my example in an Excel sheet.
    Attached Files Attached Files

  4. #4
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Sum Data in Multiple Columns

    Put the first year (2011) in K2 and this formula in L2:

    =K2+1

    Copy across to O2. Then you can put this formula in K3:

    =SUMIF($B3:$H3,K$2,$C3:$I3)

    then copy across and down as required. Note the two ranges in the SUMIF formula are offset by one column.

    Hope this helps.

    Pete

  5. #5
    Forum Expert newdoverman's Avatar
    Join Date
    02-07-2013
    Location
    Port Dover, Ontario, Canada
    MS-Off Ver
    2010
    Posts
    10,330

    Re: Sum Data in Multiple Columns

    I used the same setup as Pete but used this formula in K3 copied across and down. I didn't bother with the names as the calculation for each name is in the same row as the name.
    Formula: copy to clipboard
    Please Login or Register  to view this content.



    K
    L
    M
    N
    O
    2
    2011
    2012
    2013
    2014
    2015
    3
    225
    0
    250
    0
    0
    4
    125
    50
    0
    25
    0
    5
    0
    0
    75
    100
    20
    6
    0
    125
    0
    25
    75
    <---------If you like someone's answer, click the star to the left of one of their posts to give them a reputation point for that answer.
    Ron W

  6. #6
    Registered User
    Join Date
    12-08-2016
    Location
    Texas
    MS-Off Ver
    2016
    Posts
    3

    Re: Sum Data in Multiple Columns

    Pete, thank you so much for your help. I have been working on this issue for awhile now and your fix has not only saved my time, but has given me new knowledge that will allow me to better solve problems like this in the future. Many, many, many thanks!

  7. #7
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,733

    Re: Sum Data in Multiple Columns

    Glad to be able to help.

    If that takes care of your original question, please select Thread Tools from the menu above your first post and mark this thread as SOLVED.

    Also, since you are relatively new to the forum, you might like to know that you can directly thank those who have helped you by clicking on the small "star" icon located in the lower left corner of a post that you have found to be helpful (not just in this thread - for any post that has helped you). This also adds to the reputation of the poster (the small green bars in the poster's profile).

    Pete

+ 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] Moving multiple columns (8 x sets of 3) with data in separate rows into 3 columns
    By Emmax in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-03-2016, 01:23 PM
  2. Replies: 6
    Last Post: 11-25-2015, 01:01 PM
  3. [SOLVED] macro needed to extract specific columns out of multiple columns with their row data
    By genetist in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-07-2014, 12:49 AM
  4. Replies: 9
    Last Post: 12-15-2013, 10:05 PM
  5. Macro to copy 3 columns of data from multiple sheets into 3 columns on 1 sheet
    By bballdcm2007 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-15-2012, 04:37 PM
  6. Replies: 1
    Last Post: 03-01-2012, 09:44 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