SUMIF using OR in the conditional expression

I understand how to use the SUMIF function using checkboxes in one column for the conditional expression. I do not understand how to use it if I want to use an OR expression to OR various string values.
I want have a column called "Categories" which have a variety of string values in them like "Club" "Soccer" "School" "Church" "Home". I want to SUMIF the category is "School" or "Home". I wrote out my formula like this:
=SUMIF(Invitations::Category,OR("School","Home"), Invitations::Total in Party)
but it doesn't work. Suggestions? Thank!

Hello
The OR is the correct operator but, as far as I know, this kind of condition is not allowed.
Only a single one like "=Home" or like "=church" is allowed.
I don't know which are the other categories.
Assuming that they are "smaller than the string "church" you may use:
=SUMIF(Category,">=church",Total in Party)
If they are greater than "Home" you may use:
=SUMIF(Category,"<Home",Total in Party)
If you want to sum the values whose category matches one of three values, an alternate soluce may be to use an extraneus column (named Aux) whose formula would be
=OR(Category="church",Category="Home",Category="YK")
the final formula would be:
=SUMIF(Aux,TRUE,Total in Party)
Yvan KOENIG (from FRANCE mercredi 16 janvier 2008 14:08:41)

Similar Messages

  • Using substring in the XPATH expression for Receiver Determination

    Hello, I need a little help please.  In my receiver determination, I have a condition and I need to do a "not like" check.   Basically, if the first three positions of the source field does not start with a specific code, then I need to execute the condition.   The condition editor does not support a "not like" operand, so I went to the XPATH expression editor.  I tried to used the XPATH substring function to get the first three characters and then do a "not equal" operand, but it doesn't appear to work.  There are not any runtime errors, but the condition is not executing.  Any ideas on this?  Does the XPATH expression support the substring function?

    Hi Jesse,
    Can you please explain what is the meaning of http:// in the statement
    /p1:PRODUCT/MATNRhttp://not(substring(.,string-length(.) - 2) = '123')
    Please explein, I am having same issue. It is not working here.In My case it is
    /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,\"D\"))]
    also tried with
    /p1:ORDERS01/IDOC/E1EDP01/E1EDP19/IDTNR[http://not(starts-with(.,'D'))]
    Thanks in advance!

  • Using sql in the filter expression

    For a project I need to use a filter which is a construction
    with BETWEEN dateFrom AND dateTo.
    But the user does not choose these datevalues,
    he chooses timePeriods which have a unique startDate.
    The dashboard prompts are populated with these timePeriods and the user chooses 2 of these and 2
    presentation variables are set.
    Now I need to retrieve the according startDate for a chosen timePeriod.
    I tried to do this using a sub-query in the filter expression,
    but this seems not to be valid in Answers.
    In standard SQL it is expressed like this:
    select table1.* from table1
    where table1.dateValue  BETWEEN
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue1')+
    AND
    +(select table2.startDate from table2 where table2.timePeriod = 'theChosenValue2')+
    The return of the subqueries are single row, as it should in such constructions.
    I want the where clause to be in the filter expression for the dateValue column in Answers.(trimming of the WHERE keyword)
    Is there any other construction that does this trick in the BI Answers/Dashboard environment to do this?
    Kind regards

    Hi Micek,
    Thanks for your quick reaction.
    Yes you are right the ChosenValues will be replaced by presentation-variables in the final dashboard,
    I just am testing it with constant values in the Answers module.
    The problem seems to be that it is not allowed to use a sub-query in the filter expression.
    The Answers web application says there is a syntax problem near <select>, while I expect the SQL to be valid.
    I guess not all regular SQL is allowed in filter expressions.
    And since the report does not try to fetch data, no log of a generated, real SQL is written to the logfile.
    I need some alternative for the subquery, but one that is allowed in the filter expression.
    The problem is based on the fact that the user chooses a different value then the one that is filtered on.
    The timePeriods represent just one startDate, but I cannot use timePeriod itself to filter on.
    Because I need a between value, wich does not make sense for a timePeriod element
    such as '01-08' or 'JAN-08'.
    Several timePeriod notations are used, so using SubString and || to calculate a numeric value from the timePeriod varchar2 is not a good option.
    The error says:      
    Error getting drill information: SELECT "....
    State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. [nQSError: 27002] Near <SELECT>: Syntax error [nQSError: 26012] . (HY000)
    Any input is welcome
    kind regards

  • Can I play separate music content to different speakers using Airplay via the Airport Express?

    Can I play separate music content to different speakers using Airplay via Airport Express?

    If you mean can you simultaneously stream different audio sources to multiple speakers the answer is no. You can only stream a single source to one or more speakers.

  • Counter in the condition procedure

    Hello Gurus,
           why to use counter in the condition procedure ?  I think step is enough .
    Many thanks,
    Frank

    Hi There
    Counter can be utilised when you their is no scope for using steps and you need to introduce the new condition in pricing procedure.
    In routine you are right in saying it can be avoided
    Manu

  • No preferences for Epson R1800 when used direct or via AirPort Express

    I have recently purchased a MacbookPro. I have plugged in my R1800. I have installed the latest drivers from Epson's website. I have also followed instructions on this forum saying to reset the printers and reboot. Then install the drivers again.
    I can print on my R1800 either by plugging it in direct or using it through the AirPort Express but it only prints in very low quality. I cannot get into and printing preferences to select paper type, print quality......etc.
    Does anyone know what the problem is and how I can solve it. It's driving me crazy!

    Don't worry, i've sorted it. Updated the software for the AirPort Express an it's all working lovely. Nice bit of kit when it's working. Wish i'd updated the software a couple of hours ago.

  • Mifwash loses names of boolean conditional expression

    (FM10 on Win7x64)
    Before a mifwash, boolean expressions for conditional tags are named as: Name1, Name2, Name3.
    After the mifwash, those expressions are named Default Expression, Default Expression1 and Default Expression2.
    A quick check of the mif file shows Name1, Name2, Name3, not Default Expression, Default Expression1 or , Default Expression2.
    What am I missing?

    More detail:  the mif contains the correct names of the conditional expressions: Name1, Name2 and Name3.
    And the mif does not contain Default Expression, Default Expression1 or Default Expression2.
    Doh!
    Edit:  FM11 behaves as expected. The names of the boolean expressions in the MIF appear in the GUI and "Default Expression" does not appear.
    Now I gotta considering upgrading to FM11.

  • Minimum Set to satisfies the condition & formulae - Algorithm

    I need a solution for this problem. Please help..
    Problem:</
    Input:_
    Let N = 100
    {x y}
    {1 2} - A
    {2 3} - B
    {1 2} - C
    {1 5} - D
    Condition:_
    I can pick any set from the above, like {A, B} or {A, A, A, A....} or {A, B, D} or {A, A, B, B, C, C, C, ...} etc...
    Formulae:_
    example:
    for {A, B}, the formulae is --> (Ax + Bx)^2 + (Ay + By)^2 = N^2
    for {A, B, D}, the formulae is --> (Ax + Bx + Dx)^2 + (Ay + By + Dy)^2 = N^2
    i.e) (sum of all selected element's x value) ^ 2 + (sum of all selected element's y value) ^ 2 = N ^ 2
    Output: _
    The minimal number of elements that can be used to achieve the condition.
    example, if both {A, B} & {A, C, D} satisfies the formulae then my solution is {A, B} which has minimal elements in the set. so the output will be 2. if no solution, then return -1.
    Hope I have explained it clearly. Please help...

    First find the Pythagorean triples corresponding to a*a + b*b = N*N. This will give integer values of a and b which your x and y values should total to. This simplifies the next stage, as finding a set of values k1*x1+k2*x2+... + kn*xn = a reduces the search space somewhat - your last term will always be ( a - (k1*x1..kn-1*xn-1) ) / xn.
    Order your values so xi > xi+1. This means you can stop easily when xi == 0, and it's typically bit faster to try removing the biggest values first.
    You can also use dynamic programming to avoid some repeated calculations, but even without it's fairly fast, even for 20 or so different vectors in the basis.
        static class FindMinimimSet implements TripleProcessor {
            int bestTotal = Integer.MAX_VALUE;
            final int[][] basis;
            final int[] counts;
            final HashMap<Long,Integer> memo = new HashMap<Long,Integer>();
            // basis should be sorted by x then y with maximum values first,
            // eg { {4,3}, {4,2}, {0,4}, {0,2} }
            FindMinimimSet ( int[][] basis ) {
                this.basis = basis;
                this.counts = new int[basis.length];
            public void triple ( int a, int b, int c ) {
                bestTotal = findMinimumSet( a, b, bestTotal );
                if ( a != b )
                    bestTotal = findMinimumSet( b, a, bestTotal );
            int findMinimumSet ( int a, int b, int bestTotal ) {
                return findMinimumSet ( a, b, 0, new int[basis.length], 0, bestTotal );
            int findMinimumSet ( int a, int b, int i, int[] counts, int total, int bestTotal ) {
                long key = (a * 104729L + b) * 104729L + i;
                Integer val = memo.get(key);
                if (val == null) {
                    // TODO: record actual counts too
                    val = reallyFindMinimumSet(a,b,i,counts,total,bestTotal);
                    memo.put(key,val);
                return val;
            int reallyFindMinimumSet ( int a, int b, int i, int[] counts, int total, int bestTotal ) {
                if ( ( a == 0 ) && ( b == 0 ) ) {
                    // todo - save the counts somewhere rather than just outputting them
                    System.out.println( total + " -> " + Arrays.toString( counts ) );
                    return total;
                if ( i >= basis.length )
                    return Integer.MAX_VALUE / 2;
                int[] vector = basis;
    if ( i < basis.length - 1 ) {
    final int maxCount = Math.min ( bestTotal - total, Math.min ( ( vector[0] > 0 ) ? a / vector[0] : b, ( vector[1] > 0 ) ? ( b / vector[1] ) : a ) );
    // if the next value of x is zero, and this value isn't, count must be exact
    if ( ( vector[0] != 0 ) && ( basis[i+1][0] == 0 ) ) {
    if ( vector[0] * maxCount != a )
    return bestTotal;
    } else {               
    for ( int count = maxCount; count >= 0; --count ) {
    counts[i] = count;
    bestTotal = findMinimumSet( a - vector[0] * count, b - vector[1] * count, i+1, counts, total + count, bestTotal );
    return bestTotal;
    // only check the max count for last in vector/last with non-zero x
    final int count = Math.min( ( vector[0] > 0 ) ? a / vector[0] : b, ( vector[1] > 0 ) ? ( b / vector[1] ) : a );
    if ( total + count < bestTotal ) {
    counts[i] = count;
    bestTotal = findMinimumSet( a - vector[0] * count, b - vector[1] * count, i+1, counts, total + count, bestTotal );
    return bestTotal;
    The code to find Pythagorean triples, given the longest side:public interface TripleProcessor {
    void triple ( int a, int b, int c ) ;
    public static void findTriples ( int c, TripleProcessor out ) {
    final int c2 = c * c;
    final HashMap<Integer,Integer> squares = new HashMap<Integer,Integer>(c2);
    for ( int i = 1; i < c; ++i )
    squares.put(i*i, i);
    for ( int a = 1; a < c; ++a ) {
    final Integer b = squares.get(c2 - a*a);
    if ( b != null )
    if ( a <= b )
    out.triple(a,b,c);
    else
    break;

  • Using SUMIFS on iPad Numbers has anyone had trouble using the keypad relational symbols in the "conditions" field?

    The iPad Numbers has a very nice data entry keyboard for expressing conditions.  They have the usual =, <, > but also have the single symbol version of >=, <= and <> (as an equals with a slash through it), however, if you try to use these keypad keys in the conditions field of the SUMIFS, it returns a syntax error.  After seeing some examples of Numbers '09 I discovered I had to express a relation inside double quotes, " ", which means the text keyboard is displayed and the very nice data entry keyboard is gone along with the nice symbols.  Has anyone seen this and am I doing something wrong or is this another bug?  Thanks.

    The xxxIF functions have (for as long as I have used them) required a text string as the argument unless it was equal to a value of a cell, with no logical operators. so it is not something new, its been that way for decades and I personally think Apple might have done it differently if they didnt have to maintain compatiability with older spreadsheet programs.
    i.e. not a bug, ensures backward compatability.
    Jason

  • How to use the Dynamic Expression in BRFplus

    Hi Experts
                   I am new to BRFplus. Can you give any document on BRFplus how to use the Dynamic Expression.
    Thankyou
    Venkat

    OK I tried it and worked but for one condition:
    WHERE DECODE (E.qualification_sid, 1104,
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    But how to put two conditions for the same Expression:
    WHERE DECODE ((E.qualification_sid, 1104) AND (E.RANK_SID, 8),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    The previous code gives me this error: missing right parenthesis

  • How to use the CASE Expression in Where Cluase?

    Hi All,
    I'm trying to use the CASE Expression in the Where Clause at some trigger on the Form?
    I've tried this Code:
    Declare
    N Number;
    begin
    SELECT COUNT(E.EMP_SID)
         INTO N
         FROM EMPLOYEES E, RANKS R
         WHERE CASE WHEN R.qualification_sid = 1104 AND E.rank_sid = 8 THEN
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1)
         ELSE
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1)
         END
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR');
    END;
    When I run this code as a normal query at any SQL editor it works successfully, But When I Compile it at some trigger on the Form it gives me this error:
    Encountered the symbol "CASE" when expecting one of the following:
    ( - + mod ......
    Heeey how to specify the previous code to be shown as code in the thread?
    Note: I'm using Forms 6i

    OK I tried it and worked but for one condition:
    WHERE DECODE (E.qualification_sid, 1104,
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    But how to put two conditions for the same Expression:
    WHERE DECODE ((E.qualification_sid, 1104) AND (E.RANK_SID, 8),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.spe_per)+1),
         (TO_DATE(E.RANK_DATE, 'DD-MM-RR')+(365*M.mili_yea_per)+1))
         BETWEEN TO_DATE('01-07-2011', 'DD-MM-RR') AND TO_DATE('31-07-2011', 'DD-MM-RR')
    The previous code gives me this error: missing right parenthesis

  • Grouping the logical expressions in IF condition is not working

    Hi Experts,
        My requirement is to group the logical expressions in IF condition like the below
    I tried it like
    IF ( &NAST-KSCHL& = 'ZBE0' OR &NAST-KSCHL& = 'ZBEC' ) AND ( &VBDKR-SPRAS& <> 'F' )
      code...
    ELSEIF
      Code....
    ELSE
       code...
    ENDIF
    But the system is showing the grouping in the IF condition is wrong. The problem is i am not supposed to break that AND condition and put it as another IF inside the first IF condition.
    Pls provide your valuable inputs.
    Thanks,
      Srinivas

    Hi,
    Sometimes to play with sap script editor becomes very much difficult if you have scenario like as you mentioned..
    Type this, and i hope it will work..
    /:     IF &NAST-KSCHL& = 'ZBE0' OR &NAST-KSCHL& = 'ZBEC'   
    /:     IF &VBDKR-SPRAS& =  'F'
    your code..
    /:     ENDIF
    /:     ELSEIF <LOGICAL EXP>
    /:     IF &VBDKR-SPRAS& =  'F'
    your code..
    /:     ENDIF
    /:     ENDIF
    Now please try to use one more IF statement, give the logical expression same as in ELSEIF
    Although it is time consuming  but sill you can try..
    Edited by: Lokesh Tarey on May 26, 2010 12:30 PM

  • How to populate an EO Transient variable used in Conditional expression.

    Hi All
    I have a Unique Key Validator which has Conditional Execution in which I am checking for the value of transient variable and based on that value this validator is invoked.
    Problem is :- When this Conditional expression is processed, transient variable is not populated (code to populate it is written in getter method). As a result of which, I am not getting expected results.
    This is my conditional expression :- source.<Transient_variable> = <some value>
    I tried by replacing this expression as :- adf.object.getterMethod = <some value> , but that gave me the prototype not found error (method is present in EOImpl.java).
    How can I populate this transient variable before it is evaluated in conditional expression???
    Suggestions are welcomed!!!
    Thanks
    Nitin

    Just to explain
    Both adf.object.methodName and source.methodName are used to access EntityImpl methods. Difference is
    adf.object.methodName - used while defaulting the values of attributes
    source.methodName - used in validation expression and raising error messages/warning.
    Thanks
    Nitin

  • Does the condition specified in the function 'DECODE' allow 'BETWEEN' expression?

    Does the condition specified in the function 'DECODE' allow 'BETWEEN' expression?

    As a completely different approach, in 8i SQL and 9i PL/SQL we can use the CASE function. This delivers decode functionality, but allows us to use conditions e.g.
    SELECT CASE WHEN col BETWEEN 1 and 9 THEN 'one' ELSE 'two' END FROM my_table;I love DECODE and wouldn't use anything else for straight value substitutions but CASE does have the advantage of clarity when it comes to maths, etc. Also I believe DECODE is not ANSI compliant. In which case (ho ho!) I suspect it will probably be deprecated, as Oracle seems to be moving towards ANSI SQL compliance, as part of its open standards drive.
    Cheers, APC

  • Unable to use X Query function in  the conditional branch of Proxy Service

    Hi all,
    I need to check the string length of a node then depending on that have to call two different business services. i have added a conditional branch inside
    the proxy service. Now when I use the below expression in the I get an error
    fn:string-length(./braz:BrazilianPropertyAddress/braz:postcode)
    in variable i have given body
    I am getting the following error
    X path expression invalid not a selection declare namespace jca ="" ......................
    If I give the expression without any stringlength function there is no problem
    Kindly help

    Hi Anuj,
    Tried with text() its still throwing the same error
    [BranchNode1] Conditional branch node specifies an invalid xpath: An error was reported compiling the XPath expression: XQuery exception: line 32, column 18: {err}XP0008 [{bea-err}XP0008a]: Variable "$body" used but not declared for expression: declare namespace jca = 'http://www.bea.com/wli/sb/transports/jca';
    declare namespace wsp = 'http://schemas.xmlsoap.org/ws/2004/09/policy';
    declare namespace jms = 'http://www.bea.com/wli/sb/transports/jms';
    declare namespace tp = 'http://www.bea.com/wli/sb/transports';
    declare namespace xs = 'http://www.w3.org/2001/XMLSchema';
    declare namespace sftp = 'http://www.bea.com/wli/sb/transports/sftp';
    declare namespace flow = 'http://www.bea.com/alsb/flow/transport';
    declare namespace jpd = 'http://www.bea.com/wli/sb/transports/jpd';
    declare namespace soap-env = 'http://schemas.xmlsoap.org/soap/envelope/';
    declare namespace wsu = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd';
    declare namespace dsp = 'http://www.bea.com/dsp/transport/sb';
    declare namespace ejb = 'http://www.bea.com/wli/sb/transports/ejb';
    declare namespace wsa = 'http://schemas.xmlsoap.org/ws/2004/08/addressing';
    declare namespace bpel-10g = 'http://www.bea.com/wli/sb/transports/bpel10g';
    declare namespace tuxedo = 'http://www.bea.com/wli/sb/transports/tuxedo';
    declare namespace file = 'http://www.bea.com/wli/sb/transports/file';
    declare namespace ctx = 'http://www.bea.com/wli/sb/context';
    declare namespace fn = 'http://www.w3.org/2004/07/xpath-functions';
    declare namespace soap12-enc = 'http://www.w3.org/2003/05/soap-encoding';
    declare namespace soap12-env = 'http://www.w3.org/2003/05/soap-envelope';
    declare namespace fn-bea = 'http://www.bea.com/xquery/xquery-functions';
    declare namespace ws = 'http://www.bea.com/wli/sb/transports/ws';
    declare namespace http = 'http://www.bea.com/wli/sb/transports/http';
    declare namespace email = 'http://www.bea.com/wli/sb/transports/email';
    declare namespace ftp = 'http://www.bea.com/wli/sb/transports/ftp';
    declare namespace sb = 'http://www.bea.com/wli/sb/transports/sb';
    declare namespace xsd = 'http://www.w3.org/2001/XMLSchema';
    declare namespace soap-enc = 'http://schemas.xmlsoap.org/soap/encoding/';
    declare namespace xsi = 'http://www.w3.org/2001/XMLSchema-instance';
    declare namespace b = 'http://xmlns.oracle.com/B';
    declare namespace add = 'http://schemas.xmlsoap.org/ws/2003/03/addressing';
    fn:string-length($body/b:BProcessRequest/b:b/text())..

Maybe you are looking for