+ Reply to Thread
Results 1 to 12 of 12

Sumifs with the addition of a new constraint

  1. #1
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Sumifs with the addition of a new constraint

    Excel Gods,

    I am having trouble with my sumifs formula. I added a new constraint so my formula isn’t coming out exactly with the totals it should be.

    My worksheet called DP4Q2013 is exactly the same as worksheet 4Q2013Incurred except for the fact I added two new columns M:N to my table in worksheet DP4Q2013.

    The problem I am having is with columns AB:AG of worksheet DP4Q2013.

    The formula I have in 4Q2013Incurred is
    Please Login or Register  to view this content.
    The new formula I have in
    Please Login or Register  to view this content.
    The problem with my new formula is it doesn’t account for a few sum ranges that do not have N/A at the end of it. Some sumranges have A03, A07, A51, etc. at the end instead of N/A so my formula doesn’t sum it all of and therefore for my totals don’t match.

    Help would be greatly appreciated and thank you!
    ExcelHelp.xlsx

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Sumifs with the addition of a new constraint

    Hi, Try it like this

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    Thanks for your help AlKey, but that isn't exactly what I had wanted.

    Column AB:AG's headers are UW_G, UW_N, and UW_O. What I wanted to do is know the premiums and claims based on those three writing classes (G,N,O). Those letters can be found in column P, 5 text from the right.

    If you look at worktab 4Q2013Incurred, that was exactly what I did. But I added in a new constraint so now it is messing with my formula, and I do not know how to fix it.

  4. #4
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Sumifs with the addition of a new constraint

    Will this work for you?
    =SUMIFS($S$4:$S$178,$P$4:$P$178,$X4&"_"&RIGHT(AB$2,)&"*")
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Sumifs with the addition of a new constraint

    Quote Originally Posted by TexasBobcat View Post

    The problem with my new formula is it doesn’t account for a few sum ranges that do not have N/A at the end of it. Some sumranges have A03, A07, A51, etc. at the end instead of N/A so my formula doesn’t sum it all of and therefore for my totals don’t match.

    Can't you just add the A07 records to your list so that the SUMIF does pick them up?

    Have you thought about using a Pivot Table which is usually the first port of call for this sort of stuff.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    Quote Originally Posted by FDibbins View Post
    Will this work for you?
    =SUMIFS($S$4:$S$178,$P$4:$P$178,$X4&"_"&RIGHT(AB$2,)&"*")
    Thanks for your reply FDibbins, but that formula didn't work. It gave me the same values as the formula Alkey gave me.
    The values that are being given is the sum of all column S. I need the sums to be split in three based on if they are G, N, or O.

  7. #7
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    Thanks for your reply FDibbins, but that formula didn't work. It gave me the same values as the formula Alkey gave me.
    The values that are being given is the sum of all column S. I need the sums to be split in three based on if they are G, N, or O.

  8. #8
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    Essentially, Columns AB, AD, and AF are the same. They are looking for the sums of Column S, rec prem, based on if it is a G, N, or O.

    Columns AC, AE, and AG are the same. They are looking for the sums of Column T, claims, based on if it is a G, N, or O.

  9. #9
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    Quote Originally Posted by Richard Buttrey View Post
    Can't you just add the A07 records to your list so that the SUMIF does pick them up?

    Have you thought about using a Pivot Table which is usually the first port of call for this sort of stuff.
    I am not sure exactly what you mean by added A07 to my records, and a pivot table will not help with what I am trying to accomplish.

  10. #10
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Sumifs with the addition of a new constraint

    Quote Originally Posted by TexasBobcat View Post
    Thanks for your reply FDibbins, but that formula didn't work. It gave me the same values as the formula Alkey gave me.
    The values that are being given is the sum of all column S. I need the sums to be split in three based on if they are G, N, or O.
    That is what that formula should do if you copy it across. It is using the value in X4 and then the right-most character in AB2, and adding anything that matches those.

    If that is not what you wanted, please provide a few sample answers

  11. #11
    Registered User
    Join Date
    08-13-2015
    Location
    Houston, Texas
    MS-Off Ver
    2010
    Posts
    61

    Re: Sumifs with the addition of a new constraint

    I just figured it out. The formula I used was
    Please Login or Register  to view this content.
    I sorta incorporated what everyone said, so thank you all! Reputations all around.

  12. #12
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,939

    Re: Sumifs with the addition of a new constraint

    That is pretty much exactly what I gave you, with the addition that you did not need to manually edit when you changed columns
    =SUMIFS($S$4:$S$178,$P$4:$P$178,$X4&"_G"&"*")
    =SUMIFS($S$4:$S$178,$P$4:$P$178,$X4&"_"&RIGHT(AB$2,)&"*")

    You have trailing spaces in your headings, remove those, and then use this modified version...
    =SUMIFS($S$4:$S$178,$P$4:$P$178,$X4&RIGHT(AB$2,2)&"*")

+ 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. BUY-IN Constraint in Solver
    By WhamBam in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2012, 02:30 AM
  2. IF with more than one constraint
    By mly3 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 07-29-2008, 04:24 PM
  3. A wacky solver constraint
    By simonsays in forum Excel General
    Replies: 0
    Last Post: 09-08-2006, 05:14 PM
  4. Help Programming Limit Constraint
    By Suz84 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-02-2006, 10:10 AM
  5. Adding a constraint.
    By AhmtDY in forum Excel General
    Replies: 2
    Last Post: 05-06-2005, 05:06 AM
  6. cell value constraint
    By Balder in forum Excel General
    Replies: 2
    Last Post: 04-18-2005, 03:06 PM
  7. [SOLVED] solver constraint
    By jojo in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-18-2005, 10:06 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