+ Reply to Thread
Results 1 to 14 of 14

HELP! SUM for data in same row, but different columns with the same header

Hybrid View

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    HELP! SUM for data in same row, but different columns with the same header

    I've been trying to use variations on a "SUMIF" formula to do this calculation, but with no luck; my results keep come back "0" when that shouldn't be the case. An example of what this data looks like is as follows:

    Population Margin of Error Population Margin of Error Population Margin of Error
    A 100 200 300 400 500 600
    B 600 500 400 300 200 100
    C 300 400 100 200 600 800
    D 200 700 500 200 900 100

    Essentially I want to calculate the contents of Row A only for those cells in Row A whose column header is "Population."

    Your help is greatly appreciated. Thanks.

    Best,
    AB

  2. #2
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: HELP! SUM for data in same row, but different columns with the same header

    abarranca, welcome to the forum. Can you upload a sample workbook please.
    Brendan.


    __________________________________________________________________________________________________
    Things to consider:

    1) You can thank any poster by clicking the * at the left of a helpful post.
    2) You can help to keep the forum tidy by marking your thread as "Solved", if it has been answered to your satisfaction.
    3) Help us to help you, by uploading a sample workbook, showing the type of data you're dealing with, and clearly indicating what the results should be.

  3. #3
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    Hi AB,

    Try this in G2 then copy this cell to the rest...

    =SUMIF($A$1:$F$1,$A$1,A2:F2)

  4. #4
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: HELP! SUM for data in same row, but different columns with the same header

    I'm a newbie here. How does one upload a sample workbook?

    djapigo, thanks for the suggestion. However, it once again returned "0" for all sums. This sheet was downloaded from a government database and contains merged cells. Is it possible that the merged cells could be messing up the calculations?
    Last edited by abarranca; 11-20-2012 at 06:52 PM. Reason: typo

  5. #5
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    Hi AB, sorry for being presumptuous, but is "Population" spelled correctly? Both in Row 1 and within the formula... that includes extra spaces and all...

  6. #6
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: HELP! SUM for data in same row, but different columns with the same header

    Quote Originally Posted by djapigo View Post
    Hi AB, sorry for being presumptuous, but is "Population" spelled correctly? Both in Row 1 and within the formula... that includes extra spaces and all...
    As you can see, "Population" is not actually in the sheet; I just thought it would be a clearer Header term for an example. I'm trying to add cells across a row in all "Estimate" columns.

  7. #7
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    So, what's the formula that you are using? Also, instead of a *.jpg, can you attach and excel spreadsheet (make sure to "dumb it down" so that we don't see any sensitive information)...

    Wait, I think I figured out why you are getting 0's... it's because your Estimate numbers are actually text (hence the green triangles)... can you use this formula instead...

    =VALUE(B3)+VALUE(D3)+VALUE(F3)+etc.

  8. #8
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: HELP! SUM for data in same row, but different columns with the same header

    Quote Originally Posted by djapigo View Post
    So, what's the formula that you are using? Also, instead of a *.jpg, can you attach and excel spreadsheet (make sure to "dumb it down" so that we don't see any sensitive information)...

    Wait, I think I figured out why you are getting 0's... it's because your Estimate numbers are actually text (hence the green triangles)... can you use this formula instead...

    =VALUE(B3)+VALUE(D3)+VALUE(F3)+etc.
    I think you're right about the Cell values downloading as text. Is there some way to correct this without going into each cell individually? I found that when I did that for a few cells and reduced the range of the formula I finally got results.

    The method you propose, adding all cells manually seems fairly time consuming, no?

  9. #9
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: HELP! SUM for data in same row, but different columns with the same header

    Sheet.jpg

    This is an excerpt from the file I'm dealing with. The formula would have to calculate a SUM for 50 cells in each row separated by 50 more cells alternating in between. Essentially I want to quickly add every other cell in the row.

  10. #10
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    So, what's the formula that you are using? Also, instead of a *.jpg, can you attach and excel spreadsheet (make sure to "dumb it down" so that we don't see any sensitive information)...

  11. #11
    Valued Forum Contributor
    Join Date
    07-27-2012
    Location
    Dublin, Ireland
    MS-Off Ver
    Excel 2010
    Posts
    826

    Re: HELP! SUM for data in same row, but different columns with the same header

    I presume you don't want a picture of the answer, so have a look at the attached workbook, which shows both SUMIF & SUMIFS formula doing what I think you want to do.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    11-20-2012
    Location
    Brooklyn, NY
    MS-Off Ver
    Excel 2003
    Posts
    6

    Re: HELP! SUM for data in same row, but different columns with the same header

    Quote Originally Posted by BB1972 View Post
    I presume you don't want a picture of the answer, so have a look at the attached workbook, which shows both SUMIF & SUMIFS formula doing what I think you want to do.
    Thanks. I don't know how to upload a workbook on here yet (I just joined). The formula examples you gave are exactly the ones I've been trying to use.

  13. #13
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    Hi AB... uploading workbooks is no different on how you attached the picture...

  14. #14
    Valued Forum Contributor
    Join Date
    09-10-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    929

    Re: HELP! SUM for data in same row, but different columns with the same header

    Hi AB,

    The only way I can think of changing the column of text-numbers is to highlight that column, go to the Data tab, Text to Columns, then just press Next until Finish...

    But you must do this to each column...

    Then you can use the SUMIF function as usual...

    Good luck...

    PS Next time, download the numbers as Number/General instead of Text
    Last edited by djapigo; 11-20-2012 at 07:33 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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