Calc2Code Tips of the Day

Day 1 Part 3

So Calc2Code can help you add to Excel’s list of built-in functions to make up for Excel’s deficiencies. Sometimes, we want to simplify an Excel function. For example, Excel’s LINEST function is powerful, and calculates a lot of statistics related to multiple regression. But what if you just need one thing, like R squared? Calc2Code can be used here, as well.

Here’s an example in rsquared.xls of LINEST being called, and returning all statistics:

rsquared1

There are coefficients, standard errors, F-stats, and more, along with R-squared. The R-squared is in the first column and the third row of the results.

All we really want right now is the R-squared, perhaps because we want to create a table of R-squared values later on. So lower down we have a call to INDEX which calls into LINEST to get the range, and then returns the value in row 3 column 1 of the result, which is the R-squared. We want this cell to be the return value of our new Calc2Code generated function. We set up the configuration like this:

rsquared2

Run the builder, and end up with a function which simply returns R-squared.

Now we can use this in other spreadsheets when LINEST is more than we want, or we want to format the results a bit differently than Excel does.

Stay tuned for more tips tomorrow.

 

GET A FREE TRIAL OF CALC2CODE NOW

Fields with an asterisk are required.
First Name:

Last Name:
Company:
*Email (free trial will be sent here, we NEVER share it):
 

"Once you’ve used Calc2Code, you may find that you simply can’t be without it."

Rick Grehan, InfoWorld

"It's not just cool. It's simple."

Tom Yager, InfoWorld

"With Calc2Code, I'm able to write sophisticated C++ programs in minutes using only an Excel spreadsheet. Doing it directly in C++ would take several days."

Jerome Montpetit, Risk Manager, Canadian Financial Institution

"A highly specialized tool that can bring significant benefits to some development tasks."

Peter Aitken, DevSource

"Calc2Code does just one thing: converts Excel spreadsheets and VBA to C++ DLLs and addins. But the implications of this, and it's myriad uses, are much more far-reaching in terms of latency reduction and productivity enhancement."

Andy Webb, e-FOREX

     
  Copyright 2004-2021, Options Unlimited Research Corp.