Download AnimatedCharts-Transactions.xlsx and follow along.

We’ve built 4 charts here in Excel from pivot tables. (Note: You don’t have to use pivot tables.)

- Quarterly Sales – All Regions
- Quarterly Sales – Africa
- Quarterly Sales – North America
- Quarterly Sales – South America

Our goal is to allow each quarter to appear, one at a time.

To see the finished PowerPoint presentation files, download AnimatedCharts-Presentation.pptx.

**Copy and paste charts onto slides.**

Create a slide for each chart you’ll show. It might help to title your slides now, so you know what goes where. Then, copy the chart and paste it into the slide, choosing source formatting if you want to keep the formatting you used in Excel, or destination formatting if you want to match the PowerPoint theme you selected. Here you will also decide if you want to embed or link the chart. Pasting a picture is not an option for the type of animation we’re going to apply.

**Add entrance animation.**

With your chart selected on the slide, on the Animations tab, choose the type of animation you want to apply to each series or category of your chart. In the sample we’ve provided, we’ve chosen a different type for each one, so you can see the effect. Remember, the point of animation here is to better communicate the data! So, keep it simple.

**Modify the animation with effect options.**

Click the down arrow on the Effect Options button, next to the Animation Gallery. Select either Series or Category. Now, reveal the Animation Pane, so we can make our final adjustment. Expand the animation steps by clicking on the double down-facing arrows and delete the first animation step. This will keep the chart background in place. Click the Play button at the top of the Animation Pane to see how it looks. Animate the elements in the order you will be explaining them.

**Repeat 1-3 for each chart.**

You can stop here, if you like. Or, you can create a link back to these animations right in your Excel workbook! Save each chart slide as its own presentation. You’ll see these in the sample files as AnimatedCharts-Presentation-Chart1 through AnimatedCharts-Presentation-Chart4. On a new worksheet you will insert an Object using the Create from File option and selecting a chart. Choose a new location on the worksheet for each one.. To keep everything tied together, choose the Paste Link option. Type the instructions at the top, so the viewer knows how to open the chart in its animated version. You’ll see this in the Dashboard worksheet

Download AnimatedCharts-Presentation-Chart1.pptx

Download AnimatedCharts-Presentation-Chart2.pptx

]]>Download CompareColumnsinExcel.xlsx to follow along.

*Note: All values will appear highlighted on the This Equals That Worksheet, initially.*

If you have two lists that should be identical, but you suspect they might not be, you can put in a simple formula that sets one cell equal to another. If they are not equal, Excel returns the value FALSE. If they are, Excel returns the value TRUE. In our example, we see that Ali Mazzurah’s name has a missing h at the end, and Kathleen Kelly’s name appears with her middle initial V. in the list on the left. So, these appear as FALSE in the third column where the formula attempts to state that the value in column B is equal to the value in column C. Excel says “No it’s not!” by returning the value FALSE.

To see just your FALSE values, you can filter or apply Conditional Formatting to highlight the false ones.

In the sample workbook, with any value in column C selected, click on the Conditional Formatting button on the Home tab and choose Manage Rules to see how to highlight a whole row based on the value in one column. |

This can be done across worksheets or even workbooks!

Don’t run away! Even if you’ve never worked with a VLookUp before, this method is a good one to learn it on. Think about what you do manually to compare two lists you may have printed out. You have a value from one list that you’re pointing to with one finger. With the other finger, you’re moving down the list of likely values with the expectation that you’ll find it. If you find it, you might check it off or cross it off one of the lists, meaning it was found. Otherwise you might highlight it or circle it if it was not found in the other list. Let’s see how we can use VLookUp to do this for us, faster.

The syntax of a VLookUp formula can be thought of in this way:

- What do you want to look up?
- Where do you want to look for it?
- Which column do you want Excel to return if it finds it?
- What do you want Excel to do if it can’t find it?

In our case, we’re only comparing two columns, one in each of two separate lists. So, the “what” is the value we want to look up. The “where” is the other list. The which column is the same column we’re looking it up in, so 1. And, we want Excel to tell us if it can’t find it, we tell it not to return something close to our value (range), but our value exactly. Like our FALSE result above, VLookUp returns #N/A, telling us the thing we’re looking up is “not available.”

The “where” or Table Array field should be expressed as an Absolute Cell Reference ($A$1) or a named range so it doesn’t “travel” as we copy our formula down the list. |

In our example, the two lists are sorted differently. We locate all the names in column B in column A, but one.

The information that Excel found the value we were looking up isn’t really necessary. We really only need to see if it isn’t found. We can use an If statement to test the result of the VLookUp and return a blank if the VLookUp does not result in an #N/A.

In our first example, we could use Conditional Formatting to change the font to white if the value is TRUE, thereby making it “invisible” as long as the cell shading was empty or white. Essentially, if the value is TRUE, you want to color the font the same as the background. Another way to do this is to use the Custom format. This takes a value and changes its font color to match the background color, whatever it is!

Although TRUE and FALSE look like text values, they are actually what’s called logical values, they are treated by Excel more like numbers than as text. |

Check out CompareColumnsinExcel-solution.xlsx to see how you did!

]]>This handy VBA code will send a personalized email directly from your Excel spreadsheet via Outlook Express – no painstaking composition required.

If you are new to VBA code and programming with Excel, check out __this post__ to brush up on some basics before playing with this script.

Consider the following spreadsheet…

Employing the VBA code listed here will send an instantly generated Excel macro email to each of the four listed recipients detailing their respective bonuses as though the report had been hand-prepared:

Private Declare Function ShellExecute Lib “shell32.dll” _

Alias “ShellExecuteA” (ByVal hwnd As Long, ByVal lpOperation As String, _

ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _

ByVal nShowCmd As Long) As Long

Sub SendEMail()

Dim Email As String, Subj As String

Dim Msg As String, URL As String

Dim r As Integer, x As Double

For r = 2 To 5 ‘data in rows 2-5

‘ Get the email address

Email = Cells(r, 2)

‘ Message subject

Subj = “TEST: Your Annual Bonus”

‘ Compose the message

Msg = “”

Msg = Msg & “Dear ” & Cells(r, 1) & “,” & vbCrLf & vbCrLf

Msg = Msg & “I am pleased to inform you that your annual bonus is ”

Msg = Msg & Cells(r, 3).Text & “.” & vbCrLf & vbCrLf

Msg = Msg & “Jonathan Rosewood” & vbCrLf ‘senders name

Msg = Msg & “President” ‘senders title

‘ Replace spaces with %20 (hex)

Subj = Application.WorksheetFunction.Substitute(Subj, ” “, “%20″)

Msg = Application.WorksheetFunction.Substitute(Msg, ” “, “%20”)

‘ Replace carriage returns with %0D%0A (hex)

Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, “%0D%0A”)

‘ Create the URL

URL = “mailto:” & Email & “?subject=” & Subj & “&body=” & Msg

‘ Execute the URL (start the email client)

ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus

‘ Wait two seconds before sending keystrokes

Application.Wait (Now + TimeValue(“0:00:02”))

Application.SendKeys “%s”

Next r

End Sub

Impressive, no?

Outlook Express essentially takes dictation via your worksheet by picking out email addresses as it loops through rows and places the appropriate entries from the “Name” and “Bonus” column cells as the code requests. The code even automates the SendKeys demand to instantly deliver each message, which is typically limited to 255 characters.

However, one could even skirt the 255-character limit by copying the text to the Clipboard and adding this statement before the Application.SendKeys statement:

Application.SendKeys “{Tab}{Tab}{Tab}{Tab}{Tab}^{End}{Return}{Return}^v”

Try It!

Download the spreadsheet and paste the script into your VBA editor. You can tailor the code to fit your individual needs. Just keep in mind that if you add columns or change the order of how information appears in your spreadsheet, you will need to make adjustments to your code. Happy coding!

]]>

Advanced Excel users who are comfortable with creating and editing macros will find creating custom functions a snap. Even those who aren’t that familiar with VBA code can follow the steps below and create useful shortcuts to their calculations. This article will show how to create a very simple custom function (area of a triangle) to demonstrate the steps. You will have to figure out the math on your own!

**Prepare Your Workbook**

Because custom functions use VBA, your file must be saved as a .xlsm Macro-enabled workbook.

Follow the steps below in a new, clean macro-enabled workbook of your own, or download ** 06-Custom Functions.xlsm **to see the completed user defined function.

**Determine Your Variables**

A function creates a calculation based on variables input at the time the function is used. To create your custom function, you will first need to identify the arguments needed in your function. We are going to create a function to quickly calculate the area of a triangle: Area = Base times Height divided by 2, or A=BH/2. Our arguments will be the base and the height.

**Open Visual Basic Editor**

Hit **Alt + F11** or click the Visual Basic button the Developer tab.

Choose **Insert > Module** in the VBA editor:

**Type Code**

You will need to be familiar with VBA code to complete this step in your own work. The basic syntax of User Defined Function is:

**Function** myfunctionname (arguments) return type

Myfunctionname = calculation

**End Function**

Adding “Public” to Function tells Excel to list your User Defined Function in the **Insert Function** dialog box.

Here is simple sample code for our Triangle Area Function. When you are finished writing the code, save the function and close the editor.

**Public Function TRIAREA(number1, number2)
TRIAREA = (number1 * number2) / 2
End Function**

**Use Your User Defined Function**

Back in your Excel workbook, place your cursor in the place where you wish to insert the custom function:

- Click
**Insert Function**on the**Formulas tab**. - In the
**Insert Function**dialog box, select**User Defined**from the “select a category” dropdown list. You should see the name you gave your function. In this example we see TRIAREA. - Select the function, then click
**OK.** - Fill out the
**Function Arguments**dialog box and click**OK.**

Now you can use the TRIAREA function anytime you need to calculate the area of a triangle in your workbook. Note that you will only be able to use it in the workbook in which it was saved, it is not a global function.

**Hint!** If your variables are very specific – such as in our example, number1 will always be the Base of our triangle, and number2 will always be the Height – you can give them specific names to help you when you are completing the function in your workbook:

Conditional formatting is a useful Excel feature that can help you quickly scan your data without resorting to complicated filtering or fussy charts. Often, you will use conditional formatting to call attention to cells that represent an outlying condition – such as too many days until delivery or too few items in inventory.

Here’s how to use conditional formatting to show us that an item in our store is getting low on inventory and we will need to re-order soon:

- Highlight the cell in the row that indicates inventory, our “Units in Stock” column.
- Click
**Conditional Formatting**. - Select
**Highlight Cells Rules**, then choose the rule that applies to your needs. In this example, select**Less Than**. - Fill out the
**Less Than**dialog box and choose a formatting style from the dropdown. In Our example, we want the cell to change to red background and red text when the cell value is less than 20.

*To follow using our example, download 03-Conditional Formatting Across Multiple Cells.xls *

I’m sure you have already spotted a problem! There are many rows in our worksheet. Do I have to repeat the above for every cell in the column? Of course, the answer is “no” and Excel gives you a few quick ways to apply conditional formatting to multiple cells.

**Select Your Range Before You Begin**

By far the easiest way to apply conditional formatting to an entire column or row of cells, is to select the entire range to which the formatting will apply, *before *you define your rule. To highlight every cell with a value below twenty in our example, your steps would look like this:

- Highlight all of the cells in the sheet to which you’ll apply the formatting rules. Do NOT select headings.
- Click
**Conditional Formatting**. - Select
**Highlight Cells Rules**, then choose the rule that applies to your needs. In this example, select**Less Than**. - Fill out the
**Less Than**dialog box and choose a formatting style from the dropdown.

**Edit the Rule**

If you forget to select your range, or your range changes after you’ve applied the rule, you can modify it after the rule has been created:

- Place the cursor in any cell to which the conditional formatting rule applies.
- Click
**Conditional Formatting**, then select**Manage Rules**. - Click on the rule you wish to change. (If you don’t see your rule, you may not have selected a cell to which the rule applies. Click the
**Show formatting rules for:**dropdown and select**This Worksheet**to see all rules.) - Click inside the
**Applies to**field. - Type the new range of cells, or click the sheet button to click & drag your cursor around the new range of cells. When the
**Applies to**field reflects the correct new range, click**OK.**

**Click & Drag, Copy/Paste**

Once a conditional formatting rule has been applied to a cell, the rule will also apply to any cell that is copied from the original. This means you can copy/paste the rule (along with its contents!) and even use the copy handle to drag and copy the rule. **Caution!** Just like any other formula, you will need to pay attention to your absolute and relative cell values so that your conditional formatting rules are applied correctly.

**To delete your rule from multiple cells:**

- Open the
**Rules Manager**, select the rule and hit**Delete Rule**

**To delete all rules from your sheet:**

- Click
**Conditional Formatting > Clear Rules**and select**Clear Rules from Entire Sheet**

For more information about how to apply conditional formatting based on formulas, and how to highlight entire rows of data, view this article: **Get the Most Out of Excel’s Conditional Formatting**

If you are a fan of Excel’s conditional formatting feature, you probably find looking for even more and more ways to highlight useful information in your data. A question that often comes up among these “conditional formatting addicts” is **Can I use If/Then formula to format a cell?**

The answer is yes and no. Any conditional formatting argument must generate a TRUE result, meaning that at a literal level, your conditional formatting rule *is* an If/Then statement along the lines of “If this condition is TRUE, THEN format the cell this way”.

What conditional formatting can’t do in a *single* rule is an IF/THEN/ELSE condition such as “If # is greater than 10 format red, else format green”. Instead, this would require TWO rules, one for “greater than 10” and one for “less than 10”.

Let’s look at a few scenarios to get a sense of how we can create the effect of IF/THEN conditional formatting, even if we can’t use it in the feature itself:

*To follow using our examples, download 04-If-Then Conditional Formatting.xlsx*

**Scenario 1 (Birthdays tab)**: You want to highlight all employees in your department who have a birthday this month with Red, and all other departments blue.

**Solution: **Create two rules – one for your department, one for all others

**Step 1 – Highlight birthdays in your department**

The formula to identify birthdays in the current month will be (see this article for more about using dates in conditional formatting):

To create a formula that generates a TRUE/FALSE statement that highlights birthdays only in one department, you would use the formula:

*This example was created in April, so April birthdays will be highlighted. If you are reproducing the exercise in a different month, you will see different results! *

Then, create a second rule for the same range using this formula to highlight birthdays that are not in your department:

**BONUS!** In this example, we applied the rule to the department cell to show the relationship to the formula. By changing the **Applies to** range, however, you can easily highlight a different cell – such as the birthdate – or the entire row. See **Get the Most Out of Excel’s Conditional Formatting** for more ideas.

**Scenario 2 (Retainers tab): **You have a table of how many hours your employees have worked for specific clients, and you have a table of how many hours each client has in their retainer budget. You want to highlight the clients who are over their retainer.

**Solution 1**: Create a helper column using IF/THEN formula to call out whether a client is over their retainer budget. If your worksheet already has the IF/THEN/ELSE logic you need embedded in a cell, Conditional Formatting can act based on those results. You don’t necessarily need to reproduce the logic in the rule itself.

In this example, we already have an IF/THEN formula that returns the result “YES” if our client is over their retainer budget. Our Conditional Formatting rule, then only has to look for the text string “YES” and apply the formatting when true.

Highlight the cell range, Click on **Conditional Formatting > Highlight Cell Rules > Text that Contains** to create the Rule, then type YES in the **Text that Contains** dialog box.

**Solution 2**: Create a formula to calculate retainer budget.

If you don’t have, or don’t want to create, a helper column with an IF/THEN statement, you can use the same method as the first scenario by creating a rule that determines whether a client is over budget. In this example, we applied the rule to the **Client **cells and the formula would be:

If you are used to creating complex formulas that cover all cases in one cell, it may take a little re-learning to figure out the approach for conditional formatting that works more incrementally. The best hint is to remember that you can apply multiple rules to the same cells – break up your formatting criteria into separate steps, and you’ll most likely be able to get where you need to be!

]]>**What is nesting?**

Nesting refers to using a function as one of the arguments inside another function.

**When do you use nesting?**

Nesting functions is useful when you need to make several calculations to get to your desired answer, but don’t need to see the results of those steps as you go.

**How do I keep my nested functions straight?**

If you’ve ever looked at someone else’s worksheet and felt your eyes glaze over at the long strings of numbers, cell references and function names, you’re not alone. It takes practice to “read” complex formulas. Here are a couple of quick tips:

**Know your function’s arguments –**Knowing that the IF function has 3 arguments separated by commas (criteria, if true return, otherwise return) will help you sort out what each nested function is meant to accomplish.**Count your parenthesis**– Just like in math equations and computer programs, parenthesis keep instructions organized and tell you what order the calculations are performed. When creating nested functions, you will need to make sure that all of your open parenthesis have closing parenthesis and that they’re in the right place!**Don’t work left to right, work inside out!**– It’s tempting to try to build a complex nested formula by starting at the beginning of the line.*Instead*write the internal functions first, then place them*as a unit*into the arguments of the outer functions.

Let’s do an example. *To follow along, download 05-Nested Function Tutorial.xlsx*

Our worksheet shows six food items – 3 healthy and 3 sweet – and how many students chose each for their afternoon snack over 5 days.

We want to know how many more students, on average, chose sweet snacks instead of healthy snacks.

To make that calculation we will need the following information. To answer the question without nested functions, you could use multiple additional cells and the formulas in the example below:

- Average of each snack: =AVERAGE(B2:B6), =AVERAGE(C2:C6), =AVERAGE(D2:D6), and so on
- Average of each
*kind*of snack: =SUM(E7:G7) & =SUM(B7:D7) - Difference between healthy average and sweet average: =C9-C10

*See Multiple Cells Tab*

As you can see, each calculation is contained in its own cell, and the final “Difference” formula is built on the results of those cells. If, however, we don’t care about the average per snack or snack type, and ONLY want to see the “Difference”, we can nest our functions into one long formula.

Let’s do it first in plain language. To calculate the difference, we’ll need to subtract the total average of healthy snacks from the total average of sweet snacks:

**Difference = (average number of sweet snacks) minus (average number of healthy snacks)**

The average number of sweet snacks is calculated by adding together the average number of each individual snack in the category. Our formula will be:

**Average number of healthy snacks = (Average of Apples + Average of Bananas + Average of Carrots)****Average number of sweet snacks = (Average of Donuts + Average of Cookies + Average of Gummy Bears)**

Working inside-out, now fill each snack category parenthesis with the correct function:

**Average number of healthy snacks = SUM(AVERAGE(B2:B6), AVERAGE(C2:C6), AVERAGE(D2:D6))****Average number of sweet snacks = SUM(AVERAGE(E2:E6), AVERAGE(F2:F6), AVERAGE(G2:G6))**

Notice that the parenthesis around the SUM arguments stack up at the end. You need both end parenthesis to “close” the AVERAGE function and the SUM function.

Now, using these complete functions, we can now put them in the difference equation, for a final result of:

**=SUM(AVERAGE(E2:E6), AVERAGE(F2:F6), AVERAGE(G2:G6))– SUM(AVERAGE(B2:B6), AVERAGE(C2:C6), AVERAGE(D2:D6))**

When you plug in the above, you get the same result as the first formula, but you don’t need to have any of the additional helper cells!

*See Nested Functions Tab*

This example is probably a bit much for a simple problem, but it should illustrate the benefits and techniques of nesting functions to create more complex formulas without adding additional clutter to your sheets.

What are your tricks for working with nested functions without getting “lost in the parenthesis”?

]]>**Highlight Upcoming Birthdays**

If you are in charge of sending a birthday message to every employee each month, you can use conditional formatting to quickly highlight who has a birthday in the current month without sorting or filtering.

**How to Do It:**

- Select the range of cells that contains the birthday data. Do not include headings.
- On the
**Home**tab, click**Conditional Formatting**. - Select
**New Rule.** - Select
**Use a formula to determine which cells to format.** **Use Excel’s MONTH function to find the cells that contain birthdates in the current month. Use the TODAY function as your comparison date so the spreadsheet will always be current when you open it. (The example was written on April 20.) Your formula would be:**

- Click the
**Format**button to specify how you want the matching cell to appear. - Click
**OK**.

*To follow using our example, download FPS_Conditional Formatting Date Data.xls*

More Ideas:

- Calculate birthdays occurring in the current week:
**=WEEKNUM(C2)=WEEKNUM(TODAY())**(

**WARNING!**Note that dates can fall on different weeks in different years just as your birthday won’t be on the same day of the week each year. This method will work for highlighting upcoming birthdays on a regular basis, but may not be appropriate for other uses.) - Color code by department:
- Use the AND function to specify multiple criteria for the condition. Specify the Department in the formula, and the formatting you want in the dialog box:
**=AND(MONTH(C2)=MONTH(TODAY()),D2=”Sales”)** - Then, follow the steps above to create separate Rules for the other departments. Your results might look something like this image:

- Use the AND function to specify multiple criteria for the condition. Specify the Department in the formula, and the formatting you want in the dialog box:

**Highlight Specific Anniversaries Each Month**

If you want to highlight specific upcoming birthdays – such as a 65^{th} birthday – or anniversaries, that will take a little more formula work.

- Our first condition will find birthdays happening this month as we did above with the formula:
**=MONTH(C2)=MONTH(TODAY())** - Then we’ll use the YEAR function to find birth years that are 65 years ago:
**=YEAR(TODAY())-YEAR(C2)** - The AND function combines the two for our conditional formatting result of:
**=AND(YEAR(TODAY())-YEAR(C2)=65,MONTH(C2)=MONTH(TODAY()))**

Each time you open the workbook, you wil find the current month’s 65^{th} birthdays highlighted.

Hint! To make your birthday calculations even more visually appealing, highlight the entire row instead of just the date cell.

]]>Do you speak Excel? Are you just starting out and trying to remember the go-to lingo? Well, today’s blog post is a snapshot of helpful cheat sheet material to help you build your Excel skills.

As you continue working in Excel, you’ll learn additional uses as you build formulas to meet your specific needs. The great thing about Excel is that it is flexible enough to allow just about any calculation you might need – and now you have a reference tool to decipher it!

]]>*To follow using our example, download FPS_Apply Conditional Formatting.xlsx*

**Use Icons Instead of Formatting**

When you want a little more visual interest than colored text and backgrounds, you can use conditional formatting to display icon sets.

How to do it:

- Select the column or data range.
- Open the
**New Formatting Rule**dialog box by clicking the**Conditional Formatting**dropdown button and selecting**New Rule**. (You can use the**Icon Sets**option in the dropdown menu if default settings are acceptable.) - In the
**Format Style**dropdown menu, select**Icon Sets**. - Choose the type of icons you want in the
**Icon Style**dropdown. - In the lower half of the dialog, you can set specific criteria for how each icon is displayed. In this example, we want:
- Donors who gave 5000 and up to show a full yellow star
- Donors who gave 500-5000 to show a half yellow star
- Donors who gave 500 and less to show an empty star

You can display icons based on percentages and custom formulas by changing the **Value **and **Type** criteria.

**Highlight an entire row or column**

When you are looking at data that has many columns, highlighting just one cell might not be enough for you to see the whole picture. Instead, highlight the whole row!

How to do it:

- Select the entire data range (excluding column headings).
- Open the
**New Formatting Rule**dialog box by clicking the**Conditional Formatting**dropdown button and selecting**New Rule**. - Select
**Use a formula to determine which cells to format**. - Enter the formula that describes your conditions. In this example, we want to highlight all rows of customers from Illinois so our formula will be:
**=$D2=”Illinois”****D2**is the first cell in our data that has the text we are looking for. Because the conditional logic works like copy/paste in Excel as it is applied to each cell in the range, you need to put the**$**symbol in front of the column letter to make it absolute. Do*not*put it in front of the row number as you want the formula to evaluate each new row. - Hit
**OK**to close the dialog box and apply the formatting.

Click **Manage Rules** to view and edit the conditional formatting formulas if needed. Notice that the **Applies to** field includes the range that we selected at the beginning.

**Calculate and Highlight Date Data**

A frequent task for any business that manages personal information is to calculate ages from birthdates. Using the technique above to highlight an entire row, we can use the following formula in the **Format values where the formula is true **field to help us see which members on the list are 65 or older:

**=INT(YEARFRAC($G2,TODAY()))>65**

Learn more about date functions here.

There’s much more that conditional formatting can do for your data than highlight red text. These ideas should get you started and give you some new areas of Excel to explore!

]]>