+ Reply to Thread
Results 1 to 13 of 13

SUMIF exluding text

  1. #1
    Father
    Guest

    SUMIF exluding text

    Hello I am trying to sum data in a column based on the absence of a character
    in a related column.
    That is to say I need to be able to exclude rows that contain an "m" (there
    may be multiple characters in the criteria cell)
    Anyone have any ideas?

  2. #2
    Registered User
    Join Date
    12-28-2005
    Posts
    12
    I just Had that issue solved!
    You can use something like this, just adjust your ranges!

    =SUMIF($B$2:$B$12,"",$A$2:$A$12)

    In this case, everything in the range B2:B12 that has an empty space will add the values in their respective A column.
    Just beware that instead of NOTHING you don't have a BLANK SPACE, or it will fail.
    If you want to check for BLANK SPACES just change it to

    =SUMIF($B$2:$B$12," ",$A$2:$A$12)

  3. #3
    Father
    Guest

    Re: SUMIF exluding text

    I think I wasn't clear, if the column is blank I add it, if the column has an
    "n" in it I add it, If the column has an "m, n" I don't add it (or a "m", or
    "m, n, o" ect.) the column can have anything in it and still be added until
    there is an "m" present.

    "Hanzo" wrote:

    >
    > I just Had that issue solved!
    > You can use something like this, just adjust your ranges!
    >
    > =SUMIF($B$2:$B$12,"",$A$2:$A$12)
    >
    > In this case, everything in the range B2:B12 that has an empty space
    > will add the values in their respective A column.
    > Just beware that instead of NOTHING you don't have a BLANK SPACE, or it
    > will fail.
    > If you want to check for BLANK SPACES just change it to
    >
    > =SUMIF($B$2:$B$12," ",$A$2:$A$12)
    >
    >
    > --
    > Hanzo
    > ------------------------------------------------------------------------
    > Hanzo's Profile: http://www.excelforum.com/member.php...o&userid=29955
    > View this thread: http://www.excelforum.com/showthread...hreadid=496536
    >
    >


  4. #4
    Registered User
    Join Date
    12-28-2005
    Posts
    12
    You are right! Sorry! I misread it...
    Well, in that case the code you need is

    =SUMIF($B$2:$B$13,"<>m",$A$2:$A$13)

    The <> symbol means "DIFFERENT FROM".
    What it does is SUM everything that is not m.

    I guess that's what you really need?
    Sorry for the inconvinience!

  5. #5
    Father
    Guest

    Re: SUMIF exluding text

    Still no go

    =SUMIF($B$2:$B$13,"<>m",$A$2:$A$13) will exclude "m" but will include "m, n"
    I need it to exclude both (as well as other combinations with 'm' in them)
    "Hanzo" wrote:

    >
    > You are right! Sorry! I misread it...
    > Well, in that case the code you need is
    >
    > =SUMIF($B$2:$B$13,"<>m",$A$2:$A$13)
    >
    > The <> symbol means "DIFFERENT FROM".
    > What it does is SUM everything that is not m.
    >
    > I guess that's what you really need?
    > Sorry for the inconvinience!
    >
    >
    > --
    > Hanzo
    > ------------------------------------------------------------------------
    > Hanzo's Profile: http://www.excelforum.com/member.php...o&userid=29955
    > View this thread: http://www.excelforum.com/showthread...hreadid=496536
    >
    >


  6. #6
    Registered User
    Join Date
    12-28-2005
    Posts
    12
    LOL!
    Ok, here is the real deal!
    THere are different ways to do this, but this one is a lot simplier:

    =SUMPRODUCT($A$2:$A$13,--($B$2:$B$13<>"m"),--($B$2:$B$13<>"m,n"))

    Now, A2:A13 is your range to add. B2:B13 is the range you want to check.
    As you can see, the <> is present again to indicate DIFFERENT.
    You can add as many as you need, like

    =SUMPRODUCT($A$2:$A$13,--($B$2:$B$13<>"m"),--($B$2:$B$13<>"m,n"),--($B$2:$B$13<>"anything"),--($B$2:$B$13<>"whatever"),--($B$2:$B$13<>"etc"))

    Hope this one makes it!

  7. #7
    Ashish Mathur
    Guest

    RE: SUMIF exluding text

    Hi,

    You may also try the following array formula (Ctrl+Shift+Enter). This is in
    range B14:C17

    b 1
    n 2
    m 3
    a,m 4

    =sum(C14:C17)-SUM(IF(ISNUMBER(FIND(B16,B14:B17)),C14:C17))

    Regards,

    "Father" wrote:

    > Hello I am trying to sum data in a column based on the absence of a character
    > in a related column.
    > That is to say I need to be able to exclude rows that contain an "m" (there
    > may be multiple characters in the criteria cell)
    > Anyone have any ideas?


  8. #8
    Registered User
    Join Date
    12-28-2005
    Posts
    12
    Yep, it's your choice. As I said, there are different ways to do it.
    How ever, I found the SUMPRODUCT way easier because it works with arrays, while SUM needs to be especified by the CTRL+SHIFT+ENTER combination, and if you are editing your formula regulary and forget the combination, you'll get an awfull #VALUE error.

    Anyway, take what you find more convenient to your personal dilemma!

  9. #9
    Kleev
    Guest

    Re: SUMIF exluding text

    Looks like you need some wildcards in there:
    =SUMIF($B$2:$B$13,"<>*m*",$A$2:$A$13)

    "Father" wrote:

    > Still no go
    >
    > =SUMIF($B$2:$B$13,"<>m",$A$2:$A$13) will exclude "m" but will include "m, n"
    > I need it to exclude both (as well as other combinations with 'm' in them)
    > "Hanzo" wrote:
    >
    > >
    > > You are right! Sorry! I misread it...
    > > Well, in that case the code you need is
    > >
    > > =SUMIF($B$2:$B$13,"<>m",$A$2:$A$13)
    > >
    > > The <> symbol means "DIFFERENT FROM".
    > > What it does is SUM everything that is not m.
    > >
    > > I guess that's what you really need?
    > > Sorry for the inconvinience!
    > >
    > >
    > > --
    > > Hanzo
    > > ------------------------------------------------------------------------
    > > Hanzo's Profile: http://www.excelforum.com/member.php...o&userid=29955
    > > View this thread: http://www.excelforum.com/showthread...hreadid=496536
    > >
    > >


  10. #10
    Registered User
    Join Date
    12-28-2005
    Posts
    12
    It works if you want to bypass anything that has an m anywhere.
    It is another good option.
    However, it depends on your needs.

  11. #11
    Father
    Guest

    RE: SUMIF exluding text

    This is close to what I'm looking for, however FIND(B16,B14:B17) does not
    seem to work, it reurns #value. FIND(B16,B17) does work.

    "Ashish Mathur" wrote:

    > Hi,
    >
    > You may also try the following array formula (Ctrl+Shift+Enter). This is in
    > range B14:C17
    >
    > b 1
    > n 2
    > m 3
    > a,m 4
    >
    > =sum(C14:C17)-SUM(IF(ISNUMBER(FIND(B16,B14:B17)),C14:C17))
    >
    > Regards,
    >
    > "Father" wrote:
    >
    > > Hello I am trying to sum data in a column based on the absence of a character
    > > in a related column.
    > > That is to say I need to be able to exclude rows that contain an "m" (there
    > > may be multiple characters in the criteria cell)
    > > Anyone have any ideas?


  12. #12
    Registered User
    Join Date
    04-25-2016
    Location
    Ohio, USA
    MS-Off Ver
    2016
    Posts
    6

    Re: SUMIF exluding text

    Is is possible to combine the two formulas together?
    =SUMIF(K2:K5297, "January",J2:J5297)
    =SUMPRODUCT(J2:J5297,--(A2:A5297<>"Automotive Services"),--(A2:A5297<>"EBusiness"),--(A2:A5297<>"HR Technology"),--(A2:A5297<>"Membership Tech team"),--(A2:A5297<>"PMO"),--(L2:L5297<>"2015"),--(L2:L5297<>"2017"))

  13. #13
    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,946

    Re: SUMIF exluding text

    AJOHNSO30 welcome to the forum

    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.

    (take a look at sumifS() for this)
    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

+ 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