This tutorial looks at the **two most requested Conditional Formatting tricks** asked by Excel users.

Formatting a cell is great, but what if your data is many columns wide. Applying Conditional Formatting to the entire row will be far more effective in spreadsheets that have many columns.

For example, in the spreadsheet below I formatted the entire row where the membership in column G is Platinum.

- Select the entire table of data excluding the header row.
- Click the
**Home**tab on the Ribbon and then the**Conditional Formatting**button. - Select
**New Rule**from the list. - Click on
**Use a formula to determine which cells to format**in the top half of the screen. - Enter the required formula in the
**Format values where this formula is true**box.

The following formula was used to reference a different cell to the one being formatted. The mixed reference (column is fixed, but row is relative) of $G2 is used to check down column G, but not across the columns.

=$G2="Platinum"

- Click the
**Format**button and choose the formatting you would like to apply. - Click
**Ok**.

The Conditional Formatting tool makes it easy to set up simple conditional rules. These may be OK for most of your needs. The second of our essential Conditional Formatting tricks takes things a step further and uses multiple conditions for a rule.

To use multiple conditions in Conditional Formatting you will need to enter a formula. Depending on the logic you want to use this will likely be either the AND or OR function (Find out more on the AND and OR functions in Excel).

For example, in the image below I have formatted the entire row where the customer has been with use for 10 years or more, and they have a Platinum membership.

- Select the range of cells you want to apply the Conditional Formatting to.
- Click the
**Home**tab on the Ribbon and then the**Conditional Formatting**button. - Select
**New Rule**from the list. - Click on
**Use a formula to determine which cells to format**in the top half of the screen. - Enter the required formula in the
**Format values where this formula is true**box.

The formula below uses the AND function to ensure that both conditions are met.

=AND($F2>=10,$G2="Platinum")

- Click the
**Format**button and choose the formatting you would like to apply. - Click
**Ok**.

There is no limit to how complex this criteria may be. Conditional Formatting rules can be created to meet your needs whatever they may be, you just need to know the formulas you need to use.

- Highlight dates over 30 days old
- Managing Conditional Formatting rules
- Highlight Saturday and Sunday in a list
- Using Conditional Formatting with PivotTables

Please share your own favourite Conditional Formatting tricks by commenting on this post below.

]]>Cue the DGET function. A very powerful Excel function that will retrieve data from a record without the limitations of Vlookup. Advantages of using the DGET function include:

- It can retrieve data from a column to the left of the column you searched within.
- It can lookup data based on multiple conditions.
- It can handle both AND and OR logic.

The DGET function is a database function, a group of very powerful functions for analysing large tables of data. (More Excel training – See more on Database functions in Excel).

The DGET function is written as below;

*=DGET(database, field, criteria)*

Database |
The range of cells where you want to search for and retrieve the data. The first row must contains the headings for each column. |

Field |
The column containing the information that you want to return. This can be entered as the column’s index number i.e. 5, or you can use the column heading enclosed with quotation marks e.g. “Salesperson”. |

Criteria |
The range of cells that contain the conditions for your search. The first row must contain the column heading. |

The following formula has been entered into cell J3 in the image below it.

It looks within range A1:G800 and returns whatever data is finds in the first column. The criteria for the search is stored in range I2:I3. I2 contains the column heading of Order ID. This exactly matches the one found in row 1 of the database. Cell I2 contains the content to search for, in this case 11248.

=DGET($A$1:$G$800,1,$I$2:$I$3)

The #NUM error message is displayed if the DGET function finds more than one record that meets the search criteria.

The #Value error message is shown if no records were found matching the search criteria.

The DGET function is not case sensitive.

This required matching records from different worksheets using multiple conditions. To check if they were a duplicate, the first name, last name and company fields needed to match.

To achieve this I wrote an array formula using the IF and SUMPRODUCT functions. This can be seen below testing the data from columns A, B and C across both sheets.

{=IF(SUMPRODUCT(((Sheet1!$A$2:$A$16000)=A2)*((Sheet1!$B$2:$B$16000)=B2)*((Sheet1!$C$2:$C$16000)=C2))=1,”Yes”,””)}

An array formula has curly braces at the ends which are added when you press Ctrl + Shift and Enter to run the formula.

The SUMPRODUCT formula returns true if you all three conditions match. THE IF function then displays the word Yes if there is a match on a record, and nothing if there is no match.

The column than then be filtered by blank cells to return all the missing records.

Find out more about the SUMPRODUCT function.

How would you have solved this problem? Drop me a comment with other formulas that could have achieved the same result.

]]>