Filling Blanks with Go To-Special (and local help rant)

Recently a thread at the Eng-Tips forum prompted me to look for help on the Go To-Special function in Excel.  Pressing F5-Alt S, then clicking the help icon in the dialog box brought up:

FillBlanks2

It seems that the offline help AI can’t work out that if you click the Help icon in the Go To-Special dialog, that is probably what you want help with.  If you give it a little hint, it gets the message:

FillBlanks3

Never mind that I had just come from the Go To dialog, so I must know how to find it, I’ll follow the link to the help.  Here it is in full:

FillBlanks4

That’s it, the full extent of the offline help: the Find and Select function lets you find and select things.  It doesn’t even mention using the F5 key, let alone give any details on the “Special” options.

Using the online help works better.  It takes you straight to help on using Go To Special, and it gives a reasonable amount of detail (although still no mention of the F5 key).

FillBlanks5

Now I know that Microsoft would really, really like us to use their on line help, but dumbing down the off line help to the point of making it totally useless really isn’t the way to go about it.  There are actually good reasons for using help off line:

  • It’s quicker
  • Many people still have slow and/or unreliable connections
  • Many people like to work when travelling, or otherwise not connected to the Internet

One of the things that made the Lotus 123 spreadsheet so popular in the early days of personal computing was that it gave near instant helpful and relevant help at the touch of the F1 key.  Now more than 30 years later, in spite of processing speeds and available storage increasing by factors of thousands, the help available in Excel doesn’t come close to matching what we had then.

OK rant over, let’s get back to what we can do with Go To-Special.  The discussion linked above asked how we could use VBA to fill a table containing blanks using the last entry above the blanks as the text, and filling down to the next non-blank cell.  Left to myself I would have looped through the table cell by cell in VBA, which would work OK, but there is a much simpler way (provided by the original poster in the discussion):

Select the range to be filled, then open the Go To-Special dialog (with F5 Alt-S), and select blanks (or press k):

FillBlanks6

All the blank cells will be selected, and the cursor will move to the first blank cell.  Type “=” and select the cell immediately above:

FillBlanks7

then press Ctrl-Enter:

FillBlanks8

The table is instantly filled as required.  The remaining step is to convert all the generated formulas to text, which can be done quickly by selecting the entire table, press Ctrl-C, then Paste-Special as values.

A few lines of VBA will do all this automatically:

Sub FillInBlanks()
'select the range you want to fill in and generate formulas:
Selection.SpecialCells(xlCellTypeBlanks).FormulaR1C1 = "=+R[-1]C"

' Convert to text:
With Selection
.Copy
.PasteSpecial xlPasteValues
End With
End Sub

For more on using Go To-Special see these articles at Chandoo’s Blog:

Posted in Excel, VBA | Tagged , , , , , , | 13 Comments

Installing Windows 10 …

… did not go well.

After installing over night it needed another half hour or so to “just finish off a few things”, after which it briefly displayed the desktop, followed by a message saying that it was going to have to re-start because of an “INTERNAL_POWER_ERROR”.  Over the next half hour or so it repeated this three or four times.

Luckily someone here had the same problem and posted a very simple solution:

  • As soon as the “Windows” icon appears in the bottom left corner, right click and select Device Manager (or hold down the Windows key and press x).
  • Select Display adapters, double click the AMD driver, select the Driver tab, and click the disable button.

After that everything worked just fine, although re-starting was very slow.

Strangely, I have just checked the drivers, and the AMD driver seems to have re-enabled itself; but everything is still working.

As for opinions on Windows 10, it’s just an operating system.

Edit 4th August 2015:

I was going to say that at least the pdf content indexing and preview still worked, which it did on the day I did the upgrade, then yesterday the pdf preview stopped working.  No messages, just a blank space where the preview should be.  Looking at the Adobe site I found they now have a reader called Acrobat Reader DC, which I installed, and it worked.  I can’t say I like the new interface much, but it does the job.

Posted in Computing - general | Tagged , , , | 2 Comments

Indexing pdf content

I recently discovered that my 64 bit Windows 8.1 Search was not indexing the content of pdf files.  Since searching the content of pdf files is just about the only thing I want to do with a desktop search tool, it made the whole thing pretty pointless.  Fortunately the fix is pretty easy:

  • Go to: http://www.adobe.com/support/downloads/detail.jsp?ftpID=5542 and download PDFFilter64Setup.msi.
  • Run the download file
  • Go to “indexing options” in Control Panel (you might need to search for “search” to get it to display).
  • Click on Advanced, then the File Types tab
  • Make sure that the check box next to pdf is checked, it displays “PDF Filter” next to it, and when the pdf file line is selected the “Index Properties and File Contents” button is selected, as shown below:

pdf indexing  A few more points:

  • It seems that this problem has been around for years; it is beyond belief that it isn’t fixed yet.
  • It may or may not also be a problem with 32 bit Windows.  Make sure you install the right filter for your operating system.
  • Many reported “fixes” on the Web suggest editing the Registry, with mixed success.  I suggest trying the simple fix first.
  • I wonder what Windows 10 will do to this.

And finally:

  • When you get the index working, and want to do a search, don’t use the very un-charming Windows 8 search tool. Open File Explorer and use the search box from there.  You then get a full list of results which you can sort by date or name, and better still you can get a preview which opens near instantly, and can even be dragged to provide a readable image:

pdf indexing2

Posted in Computing - general | Tagged , , , | 2 Comments

Solvers, parsers and more

Links to some really useful recently discovered sites:

OpenSolver for Excel

OpenSolver is an Excel VBA add-in that extends Excel’s built-in Solver with more powerful solvers. It is developed and maintained by Andrew Mason and students at the Engineering Science department, University of Auckland, NZ. OpenSolver provides the following features:

  • OpenSolver offers a range of solvers for use in Excel, including the excellent, Open Source, COIN-OR CBC optimization engine which can quickly solve large Linear and Integer problems.
  • Compatible with your existing Solver models, so there is no need to change your spreadsheets
  • No artificial limits on the size of problem you can solve
  • OpenSolver is free, open source software.

Excel Formula Parsing:

RubberDuck for VBA:

Your IDE is about to enter the 21st century. Rubberduck is a free, open-source COM add-in under active development that integrates with the VBE to enable the features every programmer wants to have in their IDE.
​From unit testing to source control, from code inspections to refactorings, programming in VBA will never be the same.

FormulaDesk:

Add superpowers to Excel
Amazing tools to improve your spreadsheets

And finally, not a new link, but this looks like a really useful article:

Building an add-in for Excel:

Excel is a very powerful application with thousands of options and functions to help you build your models and reports and analyses. Oftentimes your daily job could do with some additional functionality. Something Excel does not offer “out of the box”.

With VBA, augmenting Excel with new functionality is possible. This article demonstrates how I created a small utility. It outlines all steps I used to create the tool. The principles I used in these steps may help you when set out to build your own add-in.

Posted in Excel | Tagged , , , , | 3 Comments

A mystery curve links to Jupyter

Reviewing some of my less visited links recently, I was intrigued by a post at The Math Less Travelled:

The previous post at the site provides more details of the source of the curve, and some links to an interactive curve generator written in Python, using the Jupyter Notebook. I hadn’t heard of the Jupyter Project, and I will certainly be taking a closer look in the future, but for now I thought I would have a go at creating the curve generator in Excel, which turned out to be surprisingly easy, with no coding required.

The curve is defined by the equation:
f(t) = e^{it} + \frac{1}{2} e^{6it} + \frac{i}{3} e^{-14it}
which looks fairly mysterious to a non-mathematician, but as explained at this Wikipedia article the function consists of three circles in the complex plane, which can be translated into the XY plane with two functions:
x(t) = cos(t) + cos(6t)/2 + cos(-14t)/3
y(t) = sin(t) + sin(6t)/2 + sin(-14t)/3

I have generated these values in Excel in three stages so each component of the curve can be plotted separately, and we can also add a fourth level, as shown in the screenshot below:

MCPlot5

The t values in Colum A simply increment by the value in Cell B1 (set to pi/280 in this example).  The x and y values for Curve 1 are Cos(t) and Sin(t), and the values for Curve 2 (as shown in the formula bar for the x value) are:
=COS($A3*Sheet2!C$3)/Sheet2!B$3+B3
=SIN($A3*Sheet2!C$3)/Sheet2!B$3+C3

The links t0 Sheet2 allow the factors for the curve to be easily changed.  The formulas for Curve 2 can then be copied across for Curve 3, and an additional Curve 4 is added.  The formulas in Row 3 are then copied down as far as required.  Finally the actual values to be plotted are extracted in Colums K and L with:
=INDEX($B3:$I3,K$2)
=INDEX($B3:$I3,L$2)
which are also copied down to cover the full range.

Finally values are entered in the appropriate cells on Sheet 2, and the values in Columns K and L are plotted as an XY (Scatter) chart on Sheet 2, resulting in:

MCPlot1

We can now experiment with different curves simply by entering different values under a to f, and choosing which curve to plot. Entering the same factors as c and d under e and f, and selecting curve 4 generates:
MCPlot2

Changing the sign for factor f:

MCPlot3

And increasing the value of e:

MCPlot4

The spreadsheet can be downloaded from MysteryCurve.xlsx.
No open source code this time, because there is no code.
Feel free to add slider bars and animation!

Update:

If you wondered why my plot looks a bit different to the one in the link, it’s because I didn’t get the function right; the third term is multiplied by i/3, not 1/3.  That makes it a bit more complicated, but it can still be done in code-free in Excel.  I have updated the spreadsheet using the functions Complex(), IMProduct(), IMExp(), IMReal(), and Imaginary().  See the download spreadsheet for details, or just enjoy the corrected image below:

MCPlot6

Posted in Charts, Charts, Excel, Maths, Newton | Tagged , , , , , , | 2 Comments