In the first example each of the three cubes is evaluated, and the resulting strings are concatenated into a single string function that is evaluated:

The mp-Eval function also allows values to be assigned to symbols, which can then be evaluated. In this example the letters a to d are replaced with the values in the cells to the right, and substituted into the function in cell A41:

Using the same approach, a rather simpler solution to the problem can be found:

Further discussion of the background to this problem can be found at The Math Less Travelled, which has links to on-line calculators to solve the problem summing to 42, and it is also pointed out that that the formula can be evaluated directly in Python:

Also worth a read is the Wikipedia article on the sum of three cubes, which contains further examples and numerous links.

]]>The video is short, easy to follow, and doesn’t need the sound working to understand it!

The procedure on my machine was pretty much as shown in the video except:

- The Device Manager was not listed when I clicked on the Windows Icon. Just start typing “Device Manager” and it appears.
- The Sound driver listed for my machine was “Realtek(R) Audio”
- I had to restart the computer after re-installing the driver.

]]>

I hadn’t encountered that problem before, but a quick check confirmed that it does raise an error, whatever the data type of str1 (including Integer).

There is a detailed answer to this question at:

https://stackoverflow.com/questi…

In short, the problem is that the result data type defaults to the largest type of the values being operated on, so if they are all integers the result is an integer, and since the largest value for an integer is 32767 you get an overflow.

Alternatives ways to avoid the problem include:

- Add a decimal point to at least one number, converting it to a double.
- Convert at least one value to a Long: str1 = CLng(24) * 60 * 30
- Declare at least one value as a Long constant:

`Const HrPerDay As Long = 24`

str1 = HrPerDay * 60 * 30

The variable used to receive the result of the calculation must of course also be at least a Long, since a value greater than 32767 cannot be assigned to an integer.

It might be expected that a similar problem would arise if one value was converted to a double, so that the result of the calculation was a double, and this was assigned to a Long, but in this case the data type is automatically converted by VBA to suit the variable receiving the value.

]]>The indexing process takes time, but once completed it is updated in the background with no noticeable effect on performance.

Once indexing is complete, the Windows File Explorer provides very fast searches of all indexed folders, and fast preview of selected files:

]]>The actual question, to which the answer is 42, is not known, but a lesser known long standing question involving this number has recently been solved:

The original problem, set in 1954 at the University of Cambridge, looked for Solutions of the Diophantine Equation x^3+y^3+z^3=k, with k being all the numbers from one to 100. 42 was the last remaining number (for which a solution is possible), but recently a solution was found by a team led by the University of Bristol and Massachusetts Institute of Technology. The answer is:

(-80538738812075974)^3 + 80435758145817515^3 + 12602123297335631^3

If we try to check this result in Excel we find that the available 15 significant figure accuracy is not quite up to the job:

But calling the mpmath package, via pyxll, finds that the solution is indeed correct:

]]>The spreadsheet (including open source VBA code) may be downloaded from:

Note that to keep the download file a reasonable size the file has been saved with a low resolution image. 350 x 350 resolution gives a good compromise between image quality and speed of processing and plotting.

Required input is:

- Centre point coordinates
- Plot width (= height)
- Plot resolution
- Number of iterations

The results are plotted as a scatter chart with 7 data ranges, plotting markers only.

The plot below was generated with 28 iterations, and a resolution of 350×350. Calculation time was 0.33 seconds:

The second example was taken from:

How To Quickly Compute The Mandelbrot Set In Python

Higher resolution (1000×1000) with 2048 iterations resulted in much longer calculation time, but times are 2-3 times faster than the plain Python code given in the link:

For faster plotting compiled code is required. A good site providing fast high resolution plots for user selected location, scale and number of iterations is:

The site text says the plots will not work in Microsoft browsers, but they worked with no problem for me in Internet Explorer. The image below was generated in the spreadsheet using parameters from the link above.

In my data, I have the Goal or Initial Number in column A. Then, there are 12 results in B:M of each row. Select B3:M16. Home, Conditional Formatting, New Rule, Use a Formula To Determine Which Cells To Format. The formula will be =ABS($A3-B3)=MIN(ABS($A3-$B3:$M3)). Click the Format button and choose your desired fill color or font color.

…Note the single dollar sign before the $A, $A, $B, and $M are crucial to make this work. As Conditional Formatting evaluates each cell, those dollar signs make sure that the logic is always pointing at A for the Initial cell and the range of B:M for the other values which may or may not be closer.

Note: This was created using Office 365 Insider which has access to Dynamic Arrays.

When used for conditional formatting, this formula also works with non-Insider versions of Office 365, as can be seen in my example below:

]]>- The API for the current Strand7 version (R2.4.6) does not work with 64 bit Excel.
- The beta version of the next release (R3) is available for users with a current licence, and this has a full version of the API that supports 64 bit Excel.
- The R3 beta version is currently updated on a monthly basis, and has to be reinstalled each month.
- The API sample spreadsheet currently only supports the 32 bit API. A 64 bit version will be uploaded in the near future.

]]>

A comprehensive article dealing with this problem can be found at: Declaring API functions in 64 bit Office.

The following article deals with one simple example, how to deal with calls to the microtimer function, which is the main offender amongst my spreadsheets.

Revised code from the RC Design Functions spreadsheet is shown below:

#If VBA7 Then Private Declare PtrSafe Function getFrequency Lib "kernel32" _ Alias "QueryPerformanceFrequency" (cyFrequency As Currency) As Long Private Declare PtrSafe Function getTickCount Lib "kernel32" _ Alias "QueryPerformanceCounter" (cyTickCount As Currency) As Long #Else Private Declare Function getFrequency Lib "kernel32" _ Alias "QueryPerformanceFrequency" (cyFrequency As Currency) As Long Private Declare Function getTickCount Lib "kernel32" _ Alias "QueryPerformanceCounter" (cyTickCount As Currency) As Long #End If

Note that:

- “PtrSafe” must be inserted for 64 bit Excel, and will work with recent 32 bit versions (those using VBA7), but will raise an error with earlier versions of VBA.
- With 64 bit Excel the VBA editor will show the lines without PtrSafe in red, and may raise an error during editing, but the code will run without problems with all VBA versions.

The updated version of the spreadsheet can be downloaded from: RC Design Functions8.zip

I will be progressively updating my spreadsheets as I use them, but please let me know if you are using 64 bit Excel and find a spreadsheet that has problems.

]]>

The Concrete Institute of Australia’s biennial conference is this year being held in Sydney from 8-11 September, and early-bird registration has now been extended to 15th July, so register now and save!

For more details of the conference see:

and for a lightning tour of Sydney and surrounds see:

]]>