+ Reply to Thread
Results 1 to 4 of 4

Why error: the use of OR logical operator in the SUM function

  1. #1
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    Why error: the use of OR logical operator in the SUM function

    Hi, I want to sum the positive values in column B, which satisfies the condition: date between 29/02/2012 and 31/05/2012. I used the OR function as below, but this always resulted in an error. I am wondering the problem may be due to the use of OR operator in the SUM() function.

    ={SUM(IF(OR((A1:A6<C2),(A1:A6>C1)),"",IF(B1:B6>0,B1:B6,0))}


    A B C
    30/06/2012 8 31/05/2012
    31/05/2012 4 29/02/2012
    30/04/2012 3
    31/03/2012 -2
    29/02/2012 0
    31/01/2012 5

  2. #2
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Why error: the use of OR logical operator in the SUM function

    Error is coming because of the string(double quotes) you are using. It cannot sum up the space. Use this :

    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Last edited by vikas.bhandari; 07-25-2012 at 07:13 AM. Reason: typo

  3. #3
    Forum Contributor
    Join Date
    06-18-2012
    Location
    London
    MS-Off Ver
    Excel 2019
    Posts
    347

    Re: Why error: the use of OR logical operator in the SUM function

    Just don't understand the solution

  4. #4
    Forum Contributor vikas.bhandari's Avatar
    Join Date
    04-07-2006
    Location
    Delhi, India
    MS-Off Ver
    Office 2007 and 2010
    Posts
    303

    Re: Why error: the use of OR logical operator in the SUM function

    Ok! You used "" in your formula. So the double quotes are considered as string. Your formula was unable to add it because it was finding a string for summing up. For example, if you enter a formula in a cell in excel :

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    It doesn't give you 32 as a result, but an error. Excel cannot add "". In your formula, you were providing "" to be summed up. That is why the error.

    Thanks,
    Vikas B

+ 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