+ Reply to Thread
Results 1 to 23 of 23

SUMIFS(?) I need to sum data using both horizontal and vertical criteria

  1. #1
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Hey everyone.
    I have a huge data table, and I just can't seem to find a way to sum the numbers the way I want.

    Here's an example of the table:

    ___ A B C A B C A B C A B C A B C
    Jan 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
    Jan 3 4 5 6 3 4 5 6 3 4 5 6 3 4 5
    Jan 3 4 5 6 3 4 5 6 3 4 5 6 3 4 5
    Jan 3 4 5 6 3 4 5 6 3 4 5 6 3 4 5
    Feb 3 4 5 6 3 4 5 6 3 4 5 6 3 4 5
    Feb 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    Feb 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    Feb 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    Feb 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    Mar 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    Mar 6 3 4 5 6 3 6 3 4 5 6 3 6 3 4
    ...
    ...

    I apologize if that's hard to read..
    But, in essence, I need to sum together every value that's in January AND is in a column labeled "A".

    I could just write up a bunch of "sumif=" functions but I feel like there's a simpler way..
    I tried using "sumifs=" but I don't think it can handle horizontal AND vertical criteria..

    I appreciate any help that you guys can give!
    Last edited by bighandsam; 07-20-2012 at 01:17 PM.

  2. #2
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Can you post a sample. I believe I know what you are talking about, but it would be easier if I could work with some data.
    Click on the * icon if this post has been helpful.

  3. #3
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Yes. I will get one made. Just a few minutes..!!!!!!!

  4. #4
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    I need to SUM.xlsx

    Thank you!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Like so:

    =SUMPRODUCT((MONTH($A$2:$A$61)=1)*($B$1:$Y$1="A")*$B$2:$Y$61)
    Last edited by JBeaucaire; 07-20-2012 at 02:53 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  6. #6
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    That's great JBeaucaire!
    Last edited by Xer2; 07-20-2012 at 02:52 PM.

  7. #7
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Hm.. why am I getting a sum of zero..

  8. #8
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    You typed it yourself instead of just cut/paste from the forum?

  9. #9
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Quote Originally Posted by Xer2 View Post
    Are the columns always going to be only A, B, C in a row or are there going to be other lettered columns?
    In reality, it's a set of 14 letters repeated 8 times.

    This: PTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCWPTNADLBMXSURCW

    I bolded the first P for visual sake.

  10. #10
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Quote Originally Posted by JBeaucaire View Post
    You typed it yourself instead of just cut/paste from the forum?
    Jbeaucaire, here's a photo of what I have:

    2wedj76.png

  11. #11
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Are you wanting a formula or a macro?

  12. #12
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    wait.. maybe I should decrease the range of some of those..

  13. #13
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Was posting same time as you.

    Your screenshot shows you used a different range than the example you gave us, so the formula would have to be modified to fit your range.

  14. #14
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Quote Originally Posted by Xer2 View Post
    Are you wanting a formula or a macro?
    A formula would be preferable..
    I have a gut instinct that there is some variation of the =SUM() function that can handle this..

    But it's relatively easier doing this with a macro, right?
    Last edited by bighandsam; 07-20-2012 at 03:04 PM.

  15. #15
    Forum Contributor
    Join Date
    07-05-2012
    Location
    Houston, Texas
    MS-Off Ver
    Excel 2016
    Posts
    165

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    The formula JBeaucaire provided will work if you adjust your range to the actual range of your real workbook. I'll work on some macro and show you a possible example.

  16. #16
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    GOT IT!!
    Yes, by modifying the range parameters in the equation, I got it to work perfectly.

    "=SUMPRODUCT()" will always confuse me until the end of this world.. but I can tell it's perfect for this situation!

    Thank you Jbeaucaire & Xer2 for all your help!!

    *SOLVED*

  17. #17
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Quote Originally Posted by Xer2 View Post
    The formula JBeaucaire provided will work if you adjust your range to the actual range of your real workbook. I'll work on some macro and show you a possible example.
    Thanks, Xer2.
    It it's too complicated, don't worry about it.

    I feel as though the SUMPRODUCT function suits very well for this purpose!

  18. #18
    Registered User
    Join Date
    06-26-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2010
    Posts
    22

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    I'm very thankful for everyone's help.. I can't wait until I can confidently contribute

  19. #19
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    The formula given requires YOU to edit the left-hand range to match the rows with dates to search, the top-row range where the "letter codes" are, then the final range must be the table values that match the exact same number of rows and columns.

    Based on the picture:

    =SUMPRODUCT((MONTH($A$2:$A$12)=1)*($B$1:$P$1="A")*$B$2:$P$12)

  20. #20
    Registered User
    Join Date
    06-17-2014
    Location
    Delhi
    MS-Off Ver
    2010
    Posts
    1

    SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Hi,

    Thanks for the formula, i was in same trouble and formula is not working for me... In my data set, I have names in column A and sum is required for each team members for priority P0 and P1

    Please see below sample:

    Name P0 P1 P0 P1
    Ankit 40 20 10 50
    Shruti 60 10 10 10
    Ankit 10 0 5 10
    Rahul 60 10 10 10
    Rahul 0 10 0 0
    Last edited by JBeaucaire; 06-19-2014 at 11:14 AM. Reason: Move this to its own thread. Please read and follow the Forum Rules, link above in the menu bar.

  21. #21
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    Unfortunately your post does not comply with Rule 2 of our Forum RULES. Do not post a question in the thread of another member -- start your own thread.

    If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread.

    Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too.

  22. #22
    Forum Contributor
    Join Date
    08-20-2015
    Location
    philippines
    MS-Off Ver
    2013
    Posts
    260

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    This will help me. Thanks Bighandsam

  23. #23
    Registered User
    Join Date
    01-06-2017
    Location
    Cambodia
    MS-Off Ver
    2016
    Posts
    1

    Re: SUMIFS(?) I need to sum data using both horizontal and vertical criteria

    JBeaucare, thank you so much.
    Your solution of the formula help me where I can not find solve my calculation of this kind. And thanks for the forum admin, the question owner. Cheer up together, ha ha...

+ 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