• Microsoft Office
  • Microsoft Windows
  • Other Software
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us

No products in the cart.

  • Microsoft Office
  • Microsoft Windows
  • Other Software
  • Anti Virus
  • Blog
    • Word
    • Excel
    • Powerpoint
    • Software tricks/tips
  • POLICIES
    • PAYMENT GUIDE
    • SHIPPING POLICY
    • REFUND POLICY
    • TERMS & CONDITIONS
    • Contact Us
Excel

The Double Negatives (–) in Excel

0 Comments

The Double Negatives (–) in Excel. In advanced Excel formulas, you may have come across the use of double negative signs (–) in some situations. These double minus signs serve a specific purpose in Excel formulas, especially when working with boolean values.

The primary function of double negatives is to convert boolean values into binary values. Specifically, they are used to transform TRUE and FALSE values into 1s and 0s, respectively. This is particularly useful when working with array functions and complex formulas in Excel. Let’s look at an example to understand this better.

The Double Negatives (–) in ExcelDouble Negatives 1

Example:

Suppose we have a list of numbers, and we want to count how many of them are less than 50. While the COUNTIF function can easily achieve this, let’s use the SUMPRODUCT function to learn about the double minus symbol in Excel formulas.

  • Write the following formula in cell C2: =A2:A11<50Double Negatives 2

When you hit enter, it will display “FALSE.” However, the formula is actually returning an array of TRUE and FALSE values, which you can verify by selecting the formula in edit mode and pressing the F9 key. The array will look like this: {FALSE;TRUE;TRUE;TRUE;TRUE;FALSE;TRUE;FALSE;TRUE;TRUE}, where TRUE represents values less than 50 in the range A2:A11.Double Negatives 3

  • To convert these boolean values into 1s and 0s, add the — sign before the statement: =–(A2:A11<50)

Now, when you hit enter, it will show “0” because the first value in the array is not less than 50. But if you use the debugging key F9, you will see an array of 1s and 0s: {0;1;1;1;1;0;1;0;1;1}, where each TRUE value is represented by 1.

  • To count the number of values that are less than 50, wrap the formula inside the SUMPRODUCT function: =SUMPRODUCT(–(A2:A11<50))

The formula will sum up the array returned by the internal statement, and in this case, the result will be 7.

If you were to remove the double negatives (–), and make the formula =SUMPRODUCT((A2:A11<50)), it would return 0. This is because the array returned by A2:A11<50 contains boolean values, and the SUMPRODUCT function cannot directly sum boolean values.

Alternative ways to achieve the same result of converting boolean values into binary values include adding 0 to boolean values, multiplying them by 1, or using the N function:

=SUMPRODUCT((A2:A11<50)+0) =SUMPRODUCT((A2:A11<50)*1) =SUMPRODUCT(N(A2:A11<50))Double Negatives 4

All of the above formulas will accomplish the task. While the double minus sign (–) is one way to perform this conversion, there are other valid alternatives as well. The use of double negatives was illustrated in this simple scenario, but in more complex situations, you may encounter situations where you need to convert boolean values into binary values, and these techniques can be helpful.

 

3
27 Views
10 Excel functions that every accountant must usePrev10 Excel functions that every accountant must useJuly 22, 2023
Restricting Input Based on Adjacent Cell's Specific Text in ExcelJuly 24, 2023Restricting Input Based on Adjacent Cell's Specific Text in ExcelNext

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts
  • Retrieve Data Based on Data Validation
    September 7, 2023
    Excel
  • How to Convert Multiple Rows to Columns and Rows in Excel?
    September 6, 2023
    Excel
  • VLOOKUP for Automatic Discount in Data Validation
    September 6, 2023
    Excel
  • How to Convert Text Dates to Dates in Excel?
    September 5, 2023
    Excel
Categories
  • Blog 80
  • Excel 754
  • Powerpoint 36
  • Software tricks/tips 128
  • Uncategorized 8
  • Word 109
Tags
the ISERROR
Top rated products
  • AVG Internet Security 2021 1 Device 1 Year Global AVG Internet Security 2021 1 Device 1 Year Global
    Rated 5.00 out of 5
    $11.00
  • Buy Office 2021 Professional Plus Key Global For 5 PC
    Rated 5.00 out of 5
    $45.00
  • Avast SecureLine VPN 2021 2 Years 5 Devices Global Avast SecureLine VPN 2021 2 Years 5 Devices Global
    Rated 5.00 out of 5
    $47.00
  • Windows 11 Pro Product Activation Key - Latest version 2021
    Rated 5.00 out of 5
    $11.00
  • AVG Internet Security 2021 10 Devices 1 Year Global AVG Internet Security 2021 10 Devices 1 Year Global
    Rated 5.00 out of 5
    $30.00
Products
  • Buy Office 2021 Professional Plus Key Global For 5 PC
    Rated 5.00 out of 5
    $45.00
  • Buy Office 2021 Professional Plus Key Global Bind To Your Microsoft Account
    Rated 4.83 out of 5
    $49.00
  • Windows Server 2022 Datacenter Key Global
    Rated 5.00 out of 5
    $15.00
  • Windows Server 2022 Standard Key Global
    Rated 4.47 out of 5
    $15.00
  • Windows Server 2022 Remote Desktop Services Device Connections (50) Cal Key Global
    Rated 5.00 out of 5
    $45.00

Buffcom.net always brings the best digital products and services to you. Specializing in Office Software and online marketing services

BIG SALE 50% IN MAY

Microsoft Office
Microsoft Windows
Anti-Virus
Contact Us

Visit Us:

125 Division St, New York, NY 10002, USA

Mail Us:

buffcom.net@gmail.com

TERMS & CONDITIONS | PAYMENT GUIDE  | SHIPPING POLICY  | REFUND POLICY

Copyright © 2019 buffcom.net  All Rights Reserved.