Formula Friday – Using The AND Function To Highlight Cells Meeting Multiple Logical Conditions


HAPPY FRIDAY EXCELLERS. More Formula Fun time….

Today let’s look at a small but mighty powerful formula. AND. We can use it to test multiple conditions ( up to 255 logical ones!).

The Syntax of the formuls is

=AND (logical1, [logical2], …)

 

Where

logical1 – is The first condition or logical value to evaluate

logical2 – is [optional] The second condition or logical value to evaluate

So let’s use it with conditional formatting to highlight a whole row in a data set, meeting the following conditions

Status of Refund AND over a threshold of $40,000

So, here is an extract of sales data. Including refund data. If we hightlight a row of data that contains a Refund woth over $40,000, it will make the data pop out so we can easily identify those really high value refunds issued.

AND FUNCTION

 

  • We start by selecting the data we want to conditionally format.
  • Select to create a new formatting rule.

AND FUNCTION1

  • In the new formatting rule dialog box select Use a formula to determine which cells to format
  • We can then use the AND function to look for the two criteria of Column B containing REFUND and Column E containing a value greater than $40,000
  • Let’s build the formula

= AND($B1=”REFUND”,$E1>40000)

Note the $ sign in front of the cell references – that tells Excel to keep the column the same as it explands the formula cross the row. That is how the formatting is applied to the whole row nased on the cell values.

AND FUNCTION2

  • All that’s left is to choose the formatting if both of the criteria are met
  • Hit Ok to apply the formatting

Here is the result. Excellent. My refunds over $40,000 are easily spotted now in the data.

AND FUNCTION3

The options for using a formula to conditionally format are huge, so many options!.

 

If you want to download the Example workbook to try out the formulas then you can do so below

[wpdm_package id=’9815′]

More Excel Tips_New1
Dont forget to SUBSCRIBE to the How To Excel At Excel Newsletter for more tips the first Wednesday of the month.

th

 

MR Xl 40 formulas

excel-formulas-ad-5

Barbara

Barbara is an experienced data analyst with over 20 years of experience. Author of the How To Excel At Excel Top 50 Excel tips Ebook, YouTuber and Excel Blogger.

Recent Posts