Excel logical functions

Excel logical functions

Overview

Microsoft Excel provides 4 logical functions to work with the logical values. The functions are AND, OR, XOR and NOT. You use these functions when you want to carry out more than one comparison in your formula or test multiple conditions instead of just one. As well as logical operators, Excel logical functions return either TRUE or FALSE when their arguments are evaluated.

The following table provides a short summary of what each logical function does to help you choose the right formula for a specific task.

Function

  • AND

Description - Returns TRUE if all of the arguments evaluate to TRUE.

Formula Example =AND(A2>=10, B2<5)

Formula Description - The formula returns TRUE if a value in cell A2 is greater than or equal to 10, and a value in B2 is less than 5, FALSE otherwise.

  • OR

Description - Returns TRUE if any argument evaluates to TRUE.

Formula Example =OR(A2>=10, B2<5)

Formula Description - The formula returns TRUE if A2 is greater than or equal to 10 or B2 is less than 5, or both conditions are met. If neither of the conditions it met, the formula returns FALSE.

  • XOR

Description - Returns a logical Exclusive Or of all arguments.

Formula Example =XOR(A2>=10, B2<5)

Formula Description - The formula returns TRUE if either A2 is greater than or equal to 10 or B2 is less than 5. If neither of the conditions is met or both conditions are met, the formula returns FALSE.

  • NOT

Description - Returns the reversed logical value of its argument. I.e. If the argument is FALSE, then TRUE is returned and vice versa.

Formula Example =NOT(A2>=10)

Formula Description - The formula returns FALSE if a value in cell A1 is greater than or equal to 10; TRUE otherwise.

?

In additions to the four logical functions outlined above, Microsoft Excel provides 3 "conditional" functions - IF,?IFERROR?and?IFNA.

Excel logical functions - facts and figures

1.????? In arguments of the logical functions, you can use cell references, numeric and text values, Boolean values, comparison operators, and other Excel functions. However, all arguments must evaluate to the Boolean values of TRUE or FALSE, or references or arrays containing logical values.

2.????? If an argument of a logical function contains any?empty cells, such values are ignored. If all of the arguments are empty cells, the formula returns #VALUE! error.

3.????? If an argument of a logical function contains numbers, then zero evaluates to FALSE, and all other numbers including negative numbers evaluate to TRUE. For example, if cells A1:A5 contain numbers, the formula =AND(A1:A5) will return TRUE if none of the cells contains 0, FALSE otherwise.

4.????? A logical function returns the #VALUE! error if none of the arguments evaluate to logical values.

5.????? A logical function returns the #NAME? error if you've misspell the function's name or attempted to use the function in an earlier Excel version that does not support it. For example, the XOR function can be used in Excel 2016 and 2013 only.

In Excel 2007 and higher, you can include up to 255 arguments in a logical function, provided that the total length of the formula does not exceed 8,192 characters. In Excel 2003 and lower, you can supply up to 30 arguments and the total length of your formula shall not exceed 1,024 characters.


要查看或添加评论,请登录

Vinayak Jadhav的更多文章

  • TRIMRANGE Excel Function

    TRIMRANGE Excel Function

    Summary The Excel TRIMRANGE function removes empty rows and columns from a range of data. The result is a "trimmed"…

    28 条评论
  • The Future of Excel: Emerging Trends and Technologies

    The Future of Excel: Emerging Trends and Technologies

    Excel, the ubiquitous spreadsheet software, has been a staple in businesses for decades.1 But the landscape of data…

    16 条评论
  • Must Know Differences for Excel:

    Must Know Differences for Excel:

    ?? VLOOKUP vs INDEX MATCH: VLOOKUP: Searches for a value in the first column and returns a value in the same row from a…

    12 条评论
  • UNIQUE function - quick way to find unique values in Excel

    UNIQUE function - quick way to find unique values in Excel

    The introduction of the UNIQUE function in Excel 365 has changed everything! What used to be a rocket science becomes…

    17 条评论
  • XLOOKUP or INDEX MATCH

    XLOOKUP or INDEX MATCH

    XLOOKUP vs INDEX MATCH - syntax comparison First things first, let's break down the syntax of these formulas and…

    15 条评论
  • The Power of Dynamic Array Functions

    The Power of Dynamic Array Functions

    In the ever-evolving landscape of data analysis and spreadsheet management, Microsoft Excel has taken a monumental leap…

    15 条评论
  • New Formulas in Excel 2023 Can increase Our Productive

    New Formulas in Excel 2023 Can increase Our Productive

    Microsoft Excel is a powerful spreadsheet application that can be used to automate tasks, analyze data, and create…

  • Power BI interview questions and answers

    Power BI interview questions and answers

    1. Question: What is Power BI? Answer: Power BI is a business analytics service by Microsoft that provides interactive…

    12 条评论
  • Mastering Data Cleaning and Transformation for Powerful Data Analysis

    Mastering Data Cleaning and Transformation for Powerful Data Analysis

    In the realm of data analysis, two essential stages often go hand in hand: data cleaning and data transformation. Both…

    12 条评论
  • Essential Functions in Excel for Data Preprocessing

    Essential Functions in Excel for Data Preprocessing

    Microsoft Excel is a great tool for preprocessing and handling structured data. Excel has functions and techniques…

    15 条评论

社区洞察

其他会员也浏览了