+ Reply to Thread
Results 1 to 9 of 9

SUM two columns with the same heading.

  1. #1
    Registered User
    Join Date
    05-25-2014
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    4

    SUM two columns with the same heading.

    Hi all,

    I am trying to find a formula that will sum the values of two columns with the same heading (in my case the heading is "GST"). Every month this info changes, so the GST may not be in the same column all the time. I have around 1000 rows I need to sum. Example data below:

    Amount GST Amount Total Card Fee GST Card Fee Total
    100 10 110 50 5 55

    Is there a formula when I can sum two columns based on the column NAME?

    Thanks,
    Audrey

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,938

    Re: SUM two columns with the same heading.

    Because you did not identify the version of Excel you are using, I will give you the answer if you are using 2007 or later.

    Convert your range to a Table. Name your Table as Table1. In column G, row2, type = Table1[GST] + Table1[GST2]

    Excel will automatically rename the second GST field name to GST2, because you cannot have a table with two fields named the same. Also because you have created a table, it will automatically fill down all the cells in Column G with the formula.

    Hope this clarifies your issue.

    Also for further reference, please update your profile to reflect the version of excel you are using so that the appropriate solution may be provided.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    05-25-2014
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    4

    Re: SUM two columns with the same heading.

    Quote Originally Posted by alansidman View Post
    Because you did not identify the version of Excel you are using, I will give you the answer if you are using 2007 or later.

    Convert your range to a Table. Name your Table as Table1. In column G, row2, type = Table1[GST] + Table1[GST2]

    Excel will automatically rename the second GST field name to GST2, because you cannot have a table with two fields named the same. Also because you have created a table, it will automatically fill down all the cells in Column G with the formula.

    Hope this clarifies your issue.

    Also for further reference, please update your profile to reflect the version of excel you are using so that the appropriate solution may be provided.
    Thanks for getting back to me. I use Microsoft Excel 2010 (also updated my profile to reflect this). The person that will be using this spreadsheet has limited skills with Excel so I was wondering if there was a formula that will be able to find the columns and sum them so all she had to do was dump the data that she gets into a spreadsheet.

    Thanks again,
    Audrey

  4. #4
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: SUM two columns with the same heading.

    You may try this.....

    Please Login or Register  to view this content.
    In the formula A1:F1 contains the column headers and A2:F2 contains data. You may change A2:F2 to as per your actual range of data (like A2:F5000).
    Attached Files Attached Files
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  5. #5
    Registered User
    Join Date
    05-25-2014
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    4

    Re: SUM two columns with the same heading.

    Quote Originally Posted by sktneer View Post
    You may try this.....

    Please Login or Register  to view this content.
    In the formula A1:F1 contains the column headers and A2:F2 contains data. You may change A2:F2 to as per your actual range of data (like A2:F5000).
    Thanks! that works, just to be extra picky is there a formula that can work if there's text in the data? Eg. Below.

    Type Amount GST Total Amount Type Card Fee GST Total Card Fee
    Fuel 100 10 110 Card 57 50 5 55

    Thanks,

  6. #6
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: SUM two columns with the same heading.

    If the sum range may contain text entries also, you may try this.....
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    05-25-2014
    MS-Off Ver
    Microsoft Excel 2010
    Posts
    4

    Re: SUM two columns with the same heading.

    Quote Originally Posted by sktneer View Post
    If the sum range may contain text entries also, you may try this.....
    Please Login or Register  to view this content.
    Hi, looks like this is doing a count of the data, not a sum. is there a way to sum?

  8. #8
    Valued Forum Contributor Saarang84's Avatar
    Join Date
    02-19-2009
    Location
    Chennai, India
    MS-Off Ver
    XL 2003 to 2010
    Posts
    812

    Re: SUM two columns with the same heading.

    Quote Originally Posted by smirlface View Post
    Hi, looks like this is doing a count of the data, not a sum. is there a way to sum?
    Try,
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    where A1:H1 is the header row, A2:H2 is the row containing the data you want to sum.
    Last edited by Saarang84; 05-26-2014 at 03:02 AM.
    If my assistance has helped, there is a reputation icon * on the left hand corner below the post - you can show your appreciation to the user who has helped in resolving your requirement.

    If your requirement has been solved please mark your thread as Solved.
    In the menu bar above the very first post, select Thread Tools, then select "Mark this thread as Solved".

    Kindly use [FORMULA] or [CODE] tags when posting your code.

    Regards,
    Sarang

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: SUM two columns with the same heading.

    Trying to put it all together, it's always good to have workbook at hand when trying out solutions (thanks, sktneer!)
    Attached Files Attached Files
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

+ 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. renaming columns heading
    By lastnn30 in forum Excel General
    Replies: 2
    Last Post: 04-10-2013, 09:51 PM
  2. Delete Columns according to Heading
    By marshall84 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-26-2012, 07:28 AM
  3. Heading for Columns while scrolling down
    By badcom in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 12-26-2008, 09:13 PM
  4. Replies: 1
    Last Post: 06-22-2006, 02:10 PM
  5. Adding Columns/Heading
    By debir in forum Excel General
    Replies: 0
    Last Post: 02-24-2006, 09:29 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