Inside The Web
    Facebook Twitter Instagram
    Inside The Web
    • Office
      • Excel
      • Ms Word
      • OneDrive
      • Google Docs
      • Google Sheets
      • Google Drive
    • Email
      • Gmail
      • Outlook
      • Emal Etiquette
    • Office Etiquette
    • Productivity
    Inside The Web
    Home»Office»Excel»Logical Operators in Excel (Everything You Need to Know)

    Logical Operators in Excel (Everything You Need to Know)

    Kritiraj BhandariBy Kritiraj BhandariAugust 15, 2023 Excel 5 Mins Read

    MS Excel features a variety of operators to perform calculations on any set of data. Logical operators, also known as Boolean operators, are used to compare two values and return the output as either True or False.

    If you need to check if a value in cell “X” is equal to the value in cell “Y,” you can simply use the “Equal to” operator. There exists a total of six such logical operators in Excel.

    In addition to it, you can also couple logical operators with one or more conditional functions to perform logical operations when certain conditions are met.

    “Equal to” Operator

    The “Equal to” operator is used to compare values between two cells. It can be used to compare both numerical and alphabetical data.

    Syntax: =Value1=Value2 
    Formula ExampleResult
    =A1=B1Returns TRUE if values in cells A1 and B1 are the same and FALSE otherwise. 
    =A1=“Apples”Returns TRUE if cell A1 contains the word “Apples,” FALSE otherwise.
    =A1=(B1/2)Returns TRUE if a number in cell A1 is equal to the division of B1/2, FALSE otherwise.

    Example: 

    Let us take column A with some numerical values. Now imagine we need to figure out how many of those values are equal to “10.” To perform this check, we can use the “Equal to” operator. 

    1. Chose an empty cell beside cell A2.
    2. Type in =A2=10 (A2 is the cell number for this case.)
      Equal-to-operator
    3. Hit Enter to see your result. 
      Equal-to-result

    “Not Equal to” Operator

    Excel’s “Not Equal to” operator is used in situations where you want to verify that a cell’s value is not equal to a specified value. It works opposite to the Equal to operator.

    Syntax: =Value1<>Value2
    Formula ExampleResult
    =A1<>B1Returns true if A1 contains any value other than the date 7/30/2023 and FALSE otherwise.
    =A1<>”Apples”Returns TRUE if cell A1 contains any value other than “Apples,” and FALSE if vice-versa.
    =A1<>(B1/2)Returns TRUE if a number in cell A1 is not equal to the division of B1/2 and FALSE otherwise. 
    =A1<>(DATEVALUE(“7/30/2023”)Returns true if A1 contains any value other than the date 7/30/2023 and FALSE otherwise.

    Example: 

    Let us take column A with a list of items. Suppose we have to find out how many of those items are not “Steelseries.” We can use the “Not Equal to” sign to verify it.

    1. Select the empty cell beside A2. 
    2. Type in =A2<>"Steelseries". 
      Not-Equal-to-Operator
    3. Hit Enter to view your results. 
      Not-Equal-to-results

    Greater Than Operator

    Syntax: =Value1>"X"

    It returns TRUE if Value1 is greater than “X”, and FALSE otherwise.

    Example:

    If you want to check if the values in a cell are greater than 90, then you can use the syntax above to check whether the value is greater than 90 or not. 

    Greater than operator

    Greater Than or Equal to Operator

    Syntax: =Value1>="X"

    It returns TRUE if Value1 is greater than or equal to “X”, and FALSE otherwise.

    Example:

    Using the syntax above, you can check whether a value in a cell is greater than or equal to 90 returns TRUE or not.  

    Greater than or equal to operator

    Less than Operator

    Syntax: =Value1<Value2

    It returns TRUE if Value1 is less than Value2, and FALSE otherwise.

    Example:

    To compare whether the value in cell A1 is less than that of B1, you can use the syntax mentioned above. 

    Less Than operator

    Less Than or Equal to Operator

    Syntax: =Value1<="X"

    It returns TRUE if Value1 is less than or equal to “X”, and FALSE otherwise.

    Example:

    To compare whether the value in a certain cell is less than or equal to that of another cell, you can use the syntax mentioned above. 

    Less than or equal to

    Using Conditional Function with Logical Operator

    The logical operators can also be integrated with the IF function in Excel. If you need to determine the Pass or Fail result from a set of values, then you could use logical operators with the IF function. 

    The IF function allows Excel to return a specified result based on a logical comparison between two values. 

    Syntax: =IF(Logical Condition, Output if True, Output if False)

    IF with Equal to Sign

    Suppose you want the output to return “YES” if cell A2’s value is equal to that of cell B2, you can use the IF function with the equal to sign.

    1. Open the data in Excel Sheet. 
    2. Select a cell and type =IF(Value1=Value2, “YES”,”NO”)
      If-with-equal-to-sign
    3. Hit Enter, and your result will appear. 
      If-with-equal-to-sign-result

    IF with Greater than Sign

    Suppose you have the data of exam results of 10 students. If you want to check a value in cell B2 to return “Pass” if it is greater than 40 and “Fail” otherwise, you can use the if function with greater than operator. 

    =IF (B2>40, “PASS”, “FAIL”)

    IF with Greater than sign

    The formula for using Less Than is also similar. You need to replace the “>” sign with “<.”

    IF With Less Than or Equal to Sign

    Suppose you have the data of exam results from 10 students. We will write a simple Excel formula that checks a value in cell B2 and returns “Pass” if it is greater than 40 and “Fail” otherwise. 

    =IF (B2<=40, “FAIL”, “PASS”)

    IF with less than or equal to

    Using Nested IF with logical operators

    Nested IF can be used with logical operators in multiple ways. However, for this example, we will be classifying the scores of a group of students on the basis of their exam results. 

    Let us put the names of the students in column A and their scores in column B. Now let’s classify the score on the basis of the following:

    • Excellent: Over 85
    • Good: Between 75 and 84, inclusive
    • Satisfactory: Between 65 and 74, inclusive
    • Poor: Under 65

    =IF(B2>85, "Excellent", IF(B2>=75, "Good", IF(B2>65, "Satisfactory", "Poor")))

    Nested-IF-with-Logical-Operator

    Here’s what the final output will look like.

    Nested if with operator GIF

    For further reading, you can also check out our other article on using the IF function with logical functions.

    Kritiraj Bhandari

      Meet Kriti, a proficient tech writer here at Inside the Web. Driven by a passion for continuous learning and improvement, he possesses the ability to decipher complex MS Office processes and translate them into user-friendly guides. His approach of seamlessly blending technical insights in a friendly tone is what sets him apart from the masses. As technology evolves, Kriti remains committed to staying ahead of the curve. On weekends, you are likely to find him preaching life lessons to his friends at a pub.

      Related Posts

      Excel By Nisha Gurung

      How to Compare Two Columns in Excel Using VLOOKUP

      Excel By Nisha Gurung

      How to Share Excel Files with Multiple Users

      Excel By Nisha Gurung

      How to Filter Based on a List in Excel

      Add A Comment
      Table of ContentsToggle Table of ContentToggle
      • “Equal to” Operator
      • “Not Equal to” Operator
      • Greater Than Operator
      • Greater Than or Equal to Operator
      • Less than Operator
      • Less Than or Equal to Operator
      • Using Conditional Function with Logical Operator
        • IF with Equal to Sign
        • IF with Greater than Sign
        • IF With Less Than or Equal to Sign
      • Using Nested IF with logical operators
      • Home
      • About Us
      • Privacy Policy
      © 2025 Inside The Web

      Type above and press Enter to search. Press Esc to cancel.