The spreadsheet below contains totals in every fifth row starting from row 3. We want to only add these sales totals.

The formula below is entered in cell E1.

Let’s break the formula down a little.

**ROW**: The ROW function is used to return the row number that the formula is checking. -2 has been entered on the end because the values begin from row 3. This -2 ensures that instead of using rows 7, 12, 17 and 22. Rows 5, 10, 15 and 20 are used.

**MOD**: The MOD function used to find the remainder after a number is divided by a divisor. It is used in this formula to check whether it is the fifth row or not. If it is the fifth row, after dividing the row number by five, the result will be 0.

Note: The MOD Function used in Excel VBA to check if a number is even.

**SUMPRODUCT**: The SUMPRODUCT function will perform the summing. The first array is the test for the row. This is what is returned;

{0;0;0;0;1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1}

The 1 is returned when the condition is true. This is multiplied by the range of values and then summed which gives us our total.

Note: See the SUMPRODUCT function used to count values based on multiple conditions.

I hope this explanation makes sense and you are able to adapt it for your own situation. If not, please check out this video.

Sum Every Nth Row in a List – Microsoft Excel Tips and Tricks

Essentially the graph groups numbers into intervals (bins) and displays how often they appear. The graph then beautifully illustrates how the sets of numbers are distributed.

For example, the histogram below displays the distribution of school grades from 20 pupils among different intervals.

- To create a histogram in Excel, you first need to enter the bin values (interval ranges) that you want to use. This will be the upper value of the interval e.g. for 60-70, enter 70.

Bin values have been entered in the range D4:D8 in the example below.

- Click the
**Data**tab, and then the**Data Analysis**button

If you cannot see the Data Analysis button, then the Analysis Toolpak has not been installed.

Click the **Add-Ins** button on the **Developer** tab, check the **Analysis Toolpak** button and click **OK** to install it (Having trouble? Watch this video on how to install the Analysis Toolpak add-in).

- Select the
**Histogram**tool and click**OK**.

- For the
**Input Range**, select the range of cells containing the data that you want to chart. In this example that is the school grades in B4:B23. - For the
**Bin Range**, select the interval values entered in step 1. In this example that is D4:D8. - In the
**Output Range**box, enter the cell that you want to display the frequency distribution table that will be created by the histogram tool. - Select the
**Chart Output**option.

- Click
**OK**. The result will be something like the image below.

- When you create a histogram in Excel, the initial output might not be exactly what you want. For the last steps I will make a few minor changes to improve the look of the histogram.

Click on the Legend and press **Delete**. As there is only one data series the Legend does not have a purpose.

- Edit the bin labels in the outputted frequency distribution table to something more meaningful.

- The last steps will be to resize the chart, edit the chart title and maybe apply some finishing touches such as changing the column colours and applying data labels.

The STDEV Function in Excel – The STDEV function or standard deviation function is used to show how widely spread your data is from a central point, the mean or average. It is one of the Excel statistical functions.

About Histograms – An explanation of histograms including exercises from the team at Maths Is Fun.

The COUNTIFS Function – This function is used in Excel to count all the cells within a given range that meet multiple conditions.

]]>If you have formula errors on a spreadsheet it is normally best to stop it at its source. To either correct the error, or to hide it using formulas such as ISERROR and IFERROR.

However, if your spreadsheet is large, having these IFERROR functions in every cell to protect against error values will add more calculation time to your spreadsheet.

There is a function in Excel called AGGREGATE which allows us to perform various functions on a range whilst ignoring formula errors.

The worksheet below contains formula errors that we want to ignore when calculating the total investment.

The following formula can be written into cell E17.

There is a lot more to the AGGREGATE function. For example, it can also be used to ignore hidden rows and subtotals. And it can perform 19 different functions in all so is not limited to only summing values.

Watch the video below to see the AGGREGATE function being used to sum values whilst ignoring error messages.

]]>Fortunately Excel has a full repertoire of fantastic date functions. Here are five of the best.

The TODAY function is used for a lot of good date calculation work. It returns the current date using your system clock. This is essential for so much of what you may be trying to do in Excel. As the date changes every day, this function is the technique for getting your Excel features or formulas to keep track of it so that they work every day.

It is written as below;

*=TODAY()*

No information is needed by this function as it gets what it needs from your computer.

The video below shows the TODAY function being used to highlight dates older than 30 days.

The NETWORKDAYS function is used to calculate the number of working days between two dates. It is written as;

*=NETWORKDAYS(Start Date, End Date, [Holidays])*

Holidays is optional and does not need to be supplied to the function. Holidays should be entered as a range of cells on your spreadsheet that contains the holidays.

For example, the NETWORKDAYS function can be used to calculate the number of working days between the date an order was taken and when it was dispatched.

*=NETWORKDAYS(B2,C2)*

The EDATE function returns the date a specified number of months before or after a start date. Its syntax is;

*=EDATE(Start Date, Months) *

For example, the EDATE function can be used to calculate the probation period of an employee. The formula below returns the end date of a 3 month probation period.

*=EDATE(C2, 3)*

The WORKDAY function returns a date a specified number of workdays before or after a start date. It is written as;

*=WORKDAY(Start Date, Days, [Holidays])*

For example, this function has been used in my Gantt Chart template. It calculates the finish date of a task given a start date (D7) and a tasks duration (C7). Holidays have been provided by using the nonworking range name.

*=WORKDAY(D7,C7,nonworking)*

Find out about the Excel Gantt chart template.

The DATEDIF function is used to calculate the difference between two dates. The difference can be returned as years, months or days.

This function is not documented in Excel (weirdly?) so when entering it into a cell you will not get any information. However its syntax is;

*=DATEDIF(Start Date, End Date, Interval)*

The interval should be entered as a string so using double inverted commas. Use the first letter of the interval you wish to return e.g. “y” for years or “m” for months.

The interval can also be entered as a combination. So for example “ym” would calculate the number of months between the two dates excluding years. This returns a result as if the dates were in the same year.

The DATEDIF function could be used to calculate a person’s age. For example, the formula below will calculate the age of a person as of the current date, where cell B2 contains the person’s date of birth.

*=DATEDIF(B2,TODAY(),”y”)*

If you wanted to return the persons age as how many years and months old they are we could use the formula below.

*=DATEDIF(B2,TODAY(),”y”)&” years “&DATEDIF(B2,TODAY(),”ym”)&” months”*

This formula uses the ampersand to concatenate two DATEDIF functions and some text.

Learning Excel is easy with Computergaga – browse our website to find out more

]]>Comments are fantastic for leaving notes for other users, but they can also be used to store pictures. These pictures can then be made visible when required rather than permanently displayed on screen within a cell.

- Select the cell that you want to add the comment to.
- Click the
**Review**tab on the Ribbon and then click**New Comment**. - The comment appears with text displaying the username. This text will appear on top of the picture so let’s delete it.

- Right mouse click on the border of the comment to bring up a menu and select
**Format Comment**.

- Select the
**Colors and Lines**tab on the dialog box. Click the**Color**list arrow and select**Fill Effects**. - Select the
**Picture**tab and then click the**Select Picture**button.

- Locate and select the picture you want to use. Click
**Ok**to both dialog boxes to save your changes and close them. - The picture appears within the comment box. When you click away from the comment it will disappear.

To view your comments you can simply hover your mouse over the cell containing them. You can also use the **Next** and **Previous** buttons in the Comments group of the Review tab on the Ribbon to move through your comments, or click the **Show All Comments** button to display them all.

Writing formulas can have you tearing your hair out especially when you start nesting them. Here are 4 tips to help you troubleshoot when things go wrong.

Some think the Function Wizard is for beginners but seriously, who can remember what the cryptic syntax is for every function.

So, when you get stuck simply click on the Function Wizard button to the left of the formula bar to jump in, even when you’re in the middle of writing a formula.

It’ll take you from here:

To here:

Now you have some helpful information about the function and meaning of each argument.

The syntax tool pops up as soon as you start to enter your formula.

You can move it out of the way by hovering your mouse on the very edge of the tool tip until you get the 4 headed arrow and then drag it into place:

You can also use the syntax tool to jump to a section of your formula.

Hover your mouse over the argument you want to select and when it turns blue with an underline click on it to go to that section of your formula:

See how the value_if_true argument in the formula above is highlighted to show it is selected.

When working with complex nested formulas you’ll often run into problems and it can be difficult to narrow down the cause.

The F9 key allows you to evaluate parts of your formula in isolation.

For example if I wanted to evaluate the logical_test, which is the AND function nested in my formula, I can select it using the syntax tool link:

Then press the F9 key to evaluate just that part:

And we can see it evaluates to FALSE.

You can continue selecting different parts of the formula to evaluate them one by one.

Pressing CTRL+Z will reverse the effect of the last F9 pressed. Or if you have already entered the formula pressing the Escape key will exit out of edit mode and put the formula back as it was.

The evaluate formula tool is similar to the F9 key however you cannot choose which part of the formula you want to evaluate, it will evaluate in order, which is great if you’re trying to understand how a formula works.

You’ll find it on the **Formulas tab** in the **Formula Auditing Group**:

To use it simply select the cell containing your formula and click the **Evaluate Formula** button which opens the dialog box:

This will evaluate the formula in order. Each click of the button evaluates the next section of the formula and so on.

You can also **Step In** and **Step Out** of different sections of the formula for more information on the source of different components.

**About the author**: Mynda Treacy is co-founder of My Online Training Hub, author of their comprehensive Excel Formulas library, and popular Excel Blog.

Download the Excel badminton league table.

This spreadsheet uses a few excellent Excel techniques for its functionality. These include;

- The use of tables to make referencing cells when writing formulas easier, and to make the ranges dynamic (Find out more about using Tables in your Excel spreadsheets).
- The VLOOKUP function to look up the data for the league table.
- The SUMPRODUCT function to perform analysis using multiple conditions.
- The RANK and COUNTIF functions to effectively rank the teams or players positions within the league table.

To use the spreadsheet. Simply add the team or player names to the table on the Teams sheet and fixtures sheet (Find and Replace helps here), and then enter the results into the fixtures sheet.

]]>A Gantt chart can be created in many ways to match your requirements.

This Excel Gantt chart template uses fixed scheduling on its tasks and provides a timescale of 1 full year from the project start date. To use the template;

- Enter the project start date in cell E1.
- Enter the ID and name for the tasks of your project.
- Enter the task’s estimate start dates and durations.
- Enter the % completion to update the chart with the progress of the project.

Download the Excel Gantt chart template.

Let’s look at what was used to build this Gantt chart in Excel.

A thermometer chart has been used at the top of the sheet. This chart is used to visualise the progress of the project easily. It uses the data stored in cell E4 which calculates percentage completion.

See how to create a thermometer chart in Excel.

The freeze panes feature is used to ensure that the project overview section and timescale at the top of the sheet, and also the table of task data to the left are both always visible as you navigate around the sheet.

Conditional Formatting has been used extensively in this Excel Gantt chart template to display the task progress, task % completion, non working days and today’s date.

There are 5 Conditional Formatting rules in total. To view the Conditional Formatting rule;

- Click the
**Home**tab on the Ribbon. - Click the
**Conditional Formatting**button and select**Manage Rules**. - Select
**This Worksheet**from the**Show formatting rules for**list at the top of the dialog box.

The **Format as Table** table feature found on the **Home** tab has been applied to range A6:F18. The table will grow automatically has new tasks are entered into the list. The table is named *Entry*.

A table is also used on the non working dates on the *holidays* sheet to automatically change in height if more holidays are added.

The Workday function is used to calculate the date a specified number of working days before or after a specified date.

This function has been used in the Gantt chart to calculate the finish date of each task. Non working days are entered on the *Holidays* sheet and included in the calculation.

Learn more about how to use the Workday function.

]]>Unfortunately one of the problems that arises from protecting a worksheet is the inability to spell check a worksheet.

To be able to spell check a protected worksheet you need a macro to unprotect the sheet, perform the spell check, and then protect the sheet again.

- Press
**Alt + F11**to open the Visual Basic Editor - Click
**Insert**>**Module**to insert a new code module - Copy and paste the code below into the module window being sure to replace
*Stock Sheet*with the necessary sheet name and*excel*with the necessary password.

Sub SpellCheckSheet()

Sheets(“Stock Sheet”).Unprotect “excel”

ActiveSheet.CheckSpelling

Sheets(“Stock Sheet”).Protect “excel”

End Sub

This code generates a macro called SpellCheckSheet. To run the code easily from the sheet, assign the macro to a button. This button can be placed on the toolbar and run at any time.

Create a Splash Screen in Excel

Use the Offset property in VBA

]]>

There are 20 movies to recognise from a picture. Select the film from the list below the picture. A running total is kept at the top of the sheet.

Download the Christmas movie quiz spreadsheet.

This spreadsheet can be unprotected as there is no password and the inner workings explored for learning.

Some of the Excel features used in the creating of this spreadsheet include;

- Data Validation to create the list of films to select from.
- Conditional Formatting to display the green tick or red cross if your answer was correct or not.
- An IF function is used to determine if the answer is correct or not.
- A COUNTIF function is used to create the running total in cell A1. This is then concatenated to create the text you see showing how many you have right, and how many are remaining.
- Data is stored on a hidden sheet. This has also been protected.