Question:

How do i use "or" in excel formula?r=1219313394?

by  |  earlier

0 LIKES UnLike

I want to say if x = 50 or 55 then input y

 Tags:

   Report

3 ANSWERS


  1. Your x value in A1. Your formula in B1 should read =if(OR(A1=50,A1=55),(put y value in cell B1),(put another outcome in cell B1)

    HTH


  2. Using the OR() function, to check if X1 equals 50 or 55 and result in Y1 if true, or blank "" if false.

    =IF( OR(X1=50, X1=55), Y1, "")

    You might see the same formula written like this:

    =IF( (X1=50)+(X1=55), Y1, "")

    Similarly, you could use the AND() function to check if ALL enclosed arguments are true.



  3. Returns TRUE if any argument is TRUE; returns FALSE if all arguments are FALSE.

    Syntax

    OR(logical1,logical2,...)

    Logical1,logical2,...   are 1 to 30 conditions you want to test that can be either TRUE or FALSE.

    Remarks

    The arguments must evaluate to logical values such as TRUE or FALSE, or in arrays (array: Used to build single formulas that produce multiple results or that operate on a group of arguments that are arranged in rows and columns. An array range shares a common formula; an array constant is a group of constants used as an argument.) or references that contain logical values.

    If an array or reference argument contains text or empty cells, those values are ignored.

    If the specified range contains no logical values, OR returns the #VALUE! error value.

    You can use an OR array formula to see if a value occurs in an array. To enter an array formula, press CTRL+SHIFT+ENTER.

    Example

    The example may be easier to understand if you copy it to a blank worksheet.

    How to copy an example

    Create a blank workbook or worksheet.

    Select the example in the Help topic.

    Note  Do not select the row or column headers.

    Selecting an example from Help

    Press CTRL+C.

    In the worksheet, select cell A1, and press CTRL+V.

    To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.

      

    1

    2

    3

    4

    A B

    Formula Description (Result)

    =OR(TRUE) One argument is TRUE (TRUE)

    =OR(1+1=1,2+2=5) All arguments evaluate to FALSE (FALSE)

    =OR(TRUE,FALSE,TRUE) At least one argument is TRUE (TRUE)



Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.