+ Reply to Thread
Results 1 to 6 of 6

Sum multiple columns in a table

  1. #1
    Registered User
    Join Date
    04-16-2014
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Sum multiple columns in a table

    Hello,

    I would like to sum multiple columns in a table driven by certain criteria. The criteria is text and it is specified by a text function that is date driven and it also includes a wildcard. Essentially, this table contains YTD information, each month a new columns are added. I would like the formula to update automatically when the new accounting period date is populated.

    I've tried sumif( and sum(if( using an array, but was not successful.

    Any help or suggestions would be greatly appreciated.

    Thanks.

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum multiple columns in a table

    Please post a workbook with some sample data and the results you want to see (based on that data)
    Ron
    Former Microsoft MVP - Excel (2006 - 2015)
    Click here to see the Forum Rules

  3. #3
    Registered User
    Join Date
    04-16-2014
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sum multiple columns in a table

    Can't post a workbook, but in general... the table looks like the following. For example, I need to sum all of the columns where the heading is "X-*2014"

    State X-Jan2014 Y-Jan2014 Z-Jan2014 X-Feb2014 Y-Feb2014 Z-Feb2014 X-Mar2014 Y-Mar2014 Z-Mar2014
    A
    B
    C
    D
    E

    Does that help?

  4. #4
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum multiple columns in a table

    With your sample data on Sheet1, A1:J6

    and, on Sheet2
    C1: a criteria string....X-*2014

    This regular formula returns the sum of Sheet1 data with a heading matching that pattern
    EDITED TO INCLUDE THE CORRECT FORMULA:
    Please Login or Register  to view this content.
    Another option might be:
    Please Login or Register  to view this content.
    Is that something you can work with?
    Last edited by Ron Coderre; 06-12-2014 at 01:44 PM.

  5. #5
    Registered User
    Join Date
    04-16-2014
    Location
    Washington DC
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Sum multiple columns in a table

    unfortunately, neither of these seem to work...

    the first option with the SEARCH function, appears limited to the first column of text, which is not the one of the columns i'm looking for, so the function returns a FALSE value.

    the second option seems to be similarly limited and returns a #VALUE! result.

    i tried to do a SUMPRODUCT(IF with the following:

    =SUMPRODUCT(IF(Sheet!1:1="X-*2014",1,0),Sheet!B2:XFD55)... but also unsuccessful...

    any other suggestions?

  6. #6
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996

    Re: Sum multiple columns in a table

    Quote Originally Posted by owings.jordan View Post
    unfortunately, neither of these seem to work...
    the first option with the SEARCH function, appears limited to the first column of text, which is not the one of the columns i'm looking for, so the function returns a FALSE value.
    This formula, tweaked to try to emulate your subsequent post,
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Searches B1:AZ1 for this pattern: "X-*2014"
    When it finds it, the formula includes the values from B2:AZ6 in the total.

    NOTE: It's a generally BAD idea to reference entire rows or entire columns. Many formulas (including the ones I posted won't work)
    If you need to, expand the references in the formula I posted...OR...
    convert your data to an Excel Table (Home.Format as table)
    Then you can use structured table references in your formula. Structured table references automatically expand and contract to accommodate the data in the table. Plus, the formulas are more descriptive.
    Example:
    Please Login or Register  to view this content.
    Does that help?

+ 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] Convert table with multiple header columns into a pivotable table
    By jasonleewkd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-20-2013, 03:20 AM
  2. Lookup Table with multiple columns
    By mma3824 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-13-2013, 02:27 PM
  3. Creating a Table from Multiple Columns with Multiple results
    By ChemistB in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-15-2010, 03:27 PM
  4. row data table for multiple columns
    By nabilqu in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-23-2009, 03:19 AM

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