Search Not Just Numbers

Tuesday, 3 February 2015

Excel Tip: A short introduction to named ranges

Named ranges can generate intense debate among Excel experts as everyone has their own views about how often they should be used - from those who argue that you should never directly address a cell in a formula (and should always give the cell (or range of cells) a range name, to those who only use them if they have to.

I would put myself somewhere in between the two extremes. There is certainly no denying that they can be a useful tool.

I don't expect to resolve this debate here - I merely hope to introduce you to named ranges and how to use them.

Put simply, named ranges allow you to name a cell (or range of cells) so that this name can be used in a formula instead of the actual cell reference(s).

This provides the following advantages:

  • It can be easier to see what's going on in a formula if clear names are used;
  • If a range needs to be extended or moved, the range can be edited once, rather than in every formula that refers to the range;
  • Whereas inserting rows and columns, etc. will update both formulae referring directly to the moved cells and ranges, direct references from macros will not be updated. If the macro refers to a range name then this will not be a problem - as the range will have updated;
  • Dynamic ranges - the definition of a range does not have to be a fixed reference and can be a formula. It can therefore be dependent on other variables in the spreadsheet .
There are two main ways to define a range.

The simplest way (not possible for dynamic ranges), is to select the range with the mouse and enter the chosen name in the Name Box at the top left of the screen, just below the ribbon. This will give the selected cells that range name, and you can re-select those cells at any time by selecting the name from the dropdown in the Name Box.

Note that a Range Name cannot include certain characters (most notably, spaces), but you will be told if you have tried to allocate an invalid name.

The second way is to use Define Name on the Formulas Ribbon. In the dialog box that you see when you click Define Name, you can enter your chosen range name in the box at the top, and the selected range in the box at the bottom, which will default to the cell(s) you had selected before clicking Define Name. You will not normally need to use the other two fields in the dialog box, but if you wish you can choose to confine the scope of the range to one particular worksheet, rather than the whole workbook and/or add some comments.

Note that a Range Name cannot include certain characters (most notably, spaces), but you will be told if you have tried to allocate an invalid name.

The big advantage of the second method is that you can enter a formula in the "Refers to" box, rather than just a direct reference. This can give you a dynamic range, that changes with the contents of the spreadsheet. You may, for example, use functions such as OFFSET or INDEX to determine the dynamic range.

Finally, you can use the Name Manager (next to Define Name on the Formulas Ribbon) to edit existing ranges all in one place.

To use a range name in a formula just enter the name. So let's say we have named the range A1:A4 as sales. If we wished to total these cells we could type either:

=SUM(A1:A4)

or

=SUM(sales)

And say we entered the VAT Rate in cell B1 and named it vatrate. To return the gross sales including VAT, instead of typing:

=SUM(A1:A4)*(1+B1)

we could type:

=SUM(sales)*(1+vatrate)

but now we have all of the advantages mentioned above!




If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get two freebies "The 5 Excel features that you NEED to know" and "30 Chants for Better Charts".

Tuesday, 27 January 2015

Excel Tip: Keep an eye on multiple cells

Do you ever have those situations when you are trying different scenarios and constantly checking to see what effect your twiddling is having on your results?

Wouldn't it be great if you could keep an eye on all of the cells you were interested in, without having to scroll all over the place?

Well, Excel has a nice simple tool to allow you to do exactly that.

The Watch Window tool is accessed from the Formulas ribbon, over to the right hand side of the ribbon.

When you click on the tool, it opens the Watch Window which hovers over the spreadsheet like any other toolbar.

Once the Watch Window is open you can add the cells that you want to keep your eye on by clicking Add Watch... and selecting the cells, either one by one or by selecting a whole range of cells. If you do this, all of the individual selected cells will be listed in the Watch Window. These cells can be on different worksheets and even in different workbooks.

For each cell, the Watch Window lists the Workbook, Worksheet, Name (if you have given the cell a name range), Cell reference, Value and Formula.

As you update the spreadsheet, the Watch Window will provide a live update of the effect on those cells. No more scrolling around!

Before I go, don't forget that Mynda Treacy's Excel Dashboards course is closing on Thursday, so get over there now if you don't want to miss out.

Excel Dasboard Course

If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get two freebies "The 5 Excel features that you NEED to know" and "30 Chants for Better Charts".

Tuesday, 20 January 2015

Excel Tip: Have your buttons stopped working?

Today's post refers to a problem that started occurring in early December but I have had a number of clients raise the problem in recent days, as I think the Christmas break has probably meant the problem wasn't noticed by many.

As a result, I thought it was probably still worth letting readers know about it in case they were experiencing it for the first time, or just had not managed to correct it yet.

The most common symptom of this problem is any ActiveX buttons in your spreadsheets ceasing to work. If this has happened to you and you haven't yet found a solution, read on.

The problem stems from a Microsoft security update on 9th December and applies to the 2007, 2010 and 2013 versions of Office. If you have automatic updates switched on, you will have had this update.

The update has caused problems for ActiveX controls and the most visible problem is that existing ActiveX buttons, which you may have in your spreadsheet to run macros for example, just do nothing when you try to click on them. Note that Form Control buttons are unaffected.

Full instructions from Microsoft to deal with the problem are available here:

http://support.microsoft.com/kb/3025036/EN-US

In most cases, the following will work:

In File Explorer, search for all files ending in .exd, then delete these files (they are temporary files anyway and new ones will be created next time you use  the ActiveX controls).

At the Microsoft link above there is also a script that you can run to do this if you prefer.

Before you go, just a quick reminder that the 20% discount offer on Mynda Treacy's Excel Dashboards course runs out on Thursday, so enrol now if you don't want to miss out.


Excel Dasboard Course

If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get two freebies "The 5 Excel features that you NEED to know" and "30 Chants for Better Charts".

Tuesday, 13 January 2015

Excel Tip: Enter the same data in multiple cells at once

Before I get into this week's post, I'd like to let you know that Mynda Treacy's very popular Excel Dashboards course is once again open for enrolment. If you haven't already taken this course, I'd highly recommend it, and you can get 20% off if you enrol by 22nd January. I'll also throw in my Introduction to Excel PivotTables course free of charge, just enter FEECHAN in the Coupon Code field in the Cart or Checkout.

Anyway, on with this week's post. Just a quick one this time.

In the comments of last week's post, Bill Simpson of Texas mentioned a simple little tip that I hadn't seen before. We're all still learning!

I thought I'd share it with you all too.

If you want to enter the same thing into multiple cells, you can enter it into one and copy it into each of the other cells, however a quicker solution allows you to enter the same thing into all of those cells at once.

Just take the following steps:

  • Highlight all of the relevant cells (you can use the mouse to highlight a range, or click on each of the individual cells while holding down the Ctrl key)
  • While they are all highlighted, type what you want to
  • Instead of hitting Enter, hit Ctrl + Enter, the information will appear in all of the selected cells.
That's it. Don't forget to take a look at Mynda's course while you can get 20% off.


Excel Dasboard Course

If you enjoyed this post, go to the top of the blog, where you can subscribe for regular updates and get two freebies "The 5 Excel features that you NEED to know" and "30 Chants for Better Charts".