I meant to mention that this topic was prompted by a discussion at Eng-Tips:

http://www.eng-tips.com/viewthread.cfm?qid=419388

LikeLike

]]>Tweeted a link to this one. Bill

LikeLike

]]>I have now had a look at my master copy of ConbeamU, and I don’t get the problems you describe. This makes it difficult to find the source of your problems, but I will be happy to look at your copy if you send to GMail (Dougaj4@….).

Some other things you might try are:

Download the file again, and make sure you have the latest version (4.10 23-Aug-16, see the “about” sheet).

If you want to step through the VBA code for PlotMom (or any other VBA function):

– Go to the VBA code and insert a breakpoint near the start (but not on a Dim statement line).

– Return to the spreadsheet, select the cell at the top-left corner of the PlotMom output, press F2 (to enter Edit mode), then press Ctrl-Shift-Enter, to re-enter the function. The VBA code should appear, with the break line highlighted. You can then step through the code by pressing F8.

Note that the input for PlotMom is a single range: =plotmom(F21:H53)

Hope that helps

Doug

LikeLike

]]>If you could send your copy of the file to my gmail address (dougaj4), that would be helpful.

LikeLike

]]>This is a very great work! I can obtain the curve of the results but, the diagram showing the load doesn’t work for me :-\ . When I open the ConBeamU.xlsb file I become an error that say :

Something was deleted here /xl/workbook.bin

And formula was repaire in /xl/worksheets/sheet8.bin (This sheet8 is empty also vba)

If I want to continue, exel repair the file. At the start of the sheet I can see value in the Load Graph Data table. And when I launch the calculation I become in all cell #VALUE! . I have try to debug the PlotMom function while launching it with a bouton:

PlotMom Range(“B6:B16,E6:E16,B21:E53,F21:H53”)

But I become an error 1004 because the Range method doesn’t work to call all these cells.

Have you any solution to solve the problem ?

Thank you a lot 🙂

LikeLike

]]>Now is corrected and I’m a happy user again. Have a great 2017! Greetings from Chile!

LikeLike

]]>1. The Linest function and the chart trend line do give different results sometimes. Linest tends to return coefficients of zero for one or more of the higher powers. It is usually OK up to 4th or 5th degree polynomials, but as you found, for some data it diverges even at the 4th degree.

2. Your x values, as year numbers, are large numbers over a small range, so when you raise them to the 5th power and multiply by a large coefficient you get a very large number, and when you subtract two large numbers with a small difference you get a big loss in precision.

If you replace the x range with 0 to 19 (i.e. number of years from 1995) you will find that Linest and the chart trend line give the same result, which also gives a good fit to the data.

You might also like to try the xlwSciPy spreadsheet, which links to the Python SciPy library (see https://newtonexcelbach.wordpress.com/2016/10/02/xlwscipy-1-09-update-for-xlwings-0-10-and-scipy-0-18-1/). This has an xl_PolyFit function to return the best fit polynomial coefficients, and xlPolyVal to evaluate a polynomial for any x. Both are on the SolvePoly sheet. You need to install Python to use these functions.

One other point you might like to look at is a difference in the R^2 value returned by the trend line and Linest. Both are correct, but use different definitions. See https://newtonexcelbach.wordpress.com/2009/11/03/chart-trend-lines-and-the-linest-function/

Finally, it is worth considering if the 5th degree polynomial is really more accurate, which really depends on what you intend to do with the numbers.

LikeLike

]]>http://www.eileenslounge.com/viewtopic.php?f=30&t=22787#p196639

_ Alan

LikeLike

]]>Yes I am Alan, Alan Elston, ( Doc.AElstein AT most places ).

It is a shame I have no access to Excel above XL 2010 – I might have come to my vague explanation idea a bit quicker. (The idea came after I finally realised that there is, ( in addition to the well known Range Range Property), also a less publicised Range Item Property ( and consequently what most people and Blogs explain as the Cells Property is incorrect .. http://www.excelforum.com/showthread.php?t=1154829&page=11&p=4551144#post4553399 ) )

What is a bug and what is down to just knowing what is going on seems to be argued by much more senior Excl people than me. I tend to prefer just to know as much as I am able of how the things are working. I guess strictly speaking a bug is when something does not do what it is stated to do. But once it is again personal opinion really. Because of my limited computer knowledge I am very grateful when people such as yourself give their opinion, so thanks for that.

I experimented a lot with Index and Index tricks with Arrays. I went back partially to using Ranges, at least partly, for example as the first argument, after I hit various problems . http://www.eileenslounge.com/viewtopic.php?f=27&t=22512

I then noticed that they can in some cases be much more efficient and avoid some problems, and, of course have the added advantage of avoiding the size limitations we are discussing.

Note that for Using Index to extract a 1D Array ( actually 2 D Array of 1 “column” or 1 “row” ( – I often refer to them all as “1 Breadth” Arrays ) ) from a Range, ( using the “Index slicing” trick technique), it does not involve using .Transpose provided the first argument ( Array or Range ) is set to the maximum row or column size of that you wish to extract.

If the maximum row or column size that you want returned is less than that of the maximum row or column of the first argument Array or Range, then you must use the other Index trick. The use of .Transpose is then sometimes used on the second argument as one convenient ways to produce a “vertical” Array when using this other Index trick. ( This trick allows you return an Array of values of any specific rows and columns combination from the first argument Array or Range. So you could choose , for example, one “row” and the specific “columns” required ). But you can do that “trick” without any use of any transposing. This other index trick is typically done such:

http://www.excelforum.com/showthread.php?t=1099995&highlight=

http://www.mrexcel.com/forum/excel-questions/908760-visual-basic-applications-copy-2-dimensional-array-into-1-dimensional-single-column-2.html#post4375354

( Typically you would use the “ Evaluate(“ Row .. “ ) “ type technique to get your second argument “ vertical “ Array for consecutive rows, or you would simply build a 2D 1”column” Array of your required indices. This latter could be done by building a string of indices required ( separated by say a space ) , followed by VBA.Strings.Split, and then followed finally by .Transpose. However, I think for a single “Breadth” Array, we would agree that transposing with Arrays is a very efficient alternative to using .Transpose

( I do not know why in the USEFUL GYAAN blog that he uses the transpose so much. It is not necessary and in many of his codes he transposes, then transposes back unnecessarily. I have questioned that many times, but with no answer. ). I believe many have copied the original codes, and I continually correct OPs in Forum Threads who are .Transposing then .Transposing back unecerssarily.

Note also, – I have noticed that if you are using the Index slicing trick to extract a 1D Array ( actually 2 D Array of 1 “column” or 1 “row” ) of an entire row or column from a first argument Range , then , if you declare the receiving variable as Range, then you actually get from Index a Range returned. (You can then apply the various “value” Properties, such as .Value to that to return your required Array. Of values

https://usefulgyaan.wordpress.com/2013/06/12/vba-trick-of-the-week-slicing-an-array-without-loop-application-index/#comment-587

http://www.eileenslounge.com/viewtopic.php?f=30&t=25517#p198321

This appears once again quicker anyway than using an Array as first argument, and you are not limited to the size constraints we have been talking about.

( The other Index trick will not return a Range Object under any circumstances as far as I have been able to find out. As it returns an Array of values that output Array will have the size limits we have been talking about. Note however you can use the entire worksheet as your first argument as a Range Object ( using .Cells Property ) . This I have found to be very useful and efficient also, – but it does have just one annoying “Bug” !? of loosing date info, that is to say it defaults to using .Value2 in this case rather than the usual .Value default, that is to say , despite returning a Field ( Array ) of Variant types, it “looses” the date format.)

Thanks for the Reply, Best wishes for the New Year

_ A.E.

LikeLike

]]>Cheers

Francisco

LikeLike

]]>