T^2

J

jlute

I'm trying to translate some Excel functions into an Access query but
I'm very ignorant regarding Excel functions and hope someone can
enlighten me!

The person who created the particular Excel functions used "T". Two
examples:

=0.5+0.001*T-0.0000005*T^2
=997.18+0.0031*T-0.0004*T*T

I've looked up T in the help file:
"Returns the text referred to by value."

Considering that the cells with the above functions are numeric as are
all of the cells on the sheet - what the heck are these functions
doing and why were they written this way?

Thanks in advance!
 
J

JLGWhiz

Te formulas that you posted appear to be simple mathematical equations where
T is a variable value. Without seeing the full code set it would be
difficult to absolutely define T, but if you substitute any number for T in
the equations, you will get a numeric result.
 
D

Dave Peterson

It looks as though the developer defined a name called T.
(Insert|Name|define in xl2003 menus).

You could go through that same menu to find out what T referred to--a cell, a
formula, a constant or whatever???
 
C

Chuck

I'm trying to translate some Excel functions into an Access query but
I'm very ignorant regarding Excel functions and hope someone can
enlighten me!

The person who created the particular Excel functions used "T". Two
examples:

=0.5+0.001*T-0.0000005*T^2
=997.18+0.0031*T-0.0004*T*T

I've looked up T in the help file:
"Returns the text referred to by value."

Considering that the cells with the above functions are numeric as are
all of the cells on the sheet - what the heck are these functions
doing and why were they written this way?

Thanks in advance!
In general those are equations for parabolas, but because of the constants they
are going to be very close to straight lines. The equations would be written
exactly the same in Access. T^2 = T*T = "T squared" or the number times
itself. Generally in Excel and Access T^2 would be used. Some programming
languages do not recognize the "^" symbol, in that case T*T would be used.
It's been a long time but I believe that VB6 does not recognize the ^ symbol.

Chuck
--
 
C

Chuck

Yes, VB6 does indeed recognize the power symbol.
You are absolutely correct. I should have checked. It was Turbo Pascal (DOS)
that did not use the ^ symbol. I just checked.
Pascal: X^A is written exp(A*ln(X))
 
R

Rick Rothstein

It's been a (long, long) while since I looked at Turbo Pascal, but I thought
it used what Fortran (also been a long, long while since I looked at this
also) used for powers... the double asterisk symbol. I would have thought
your VB example of X^A would have been X**A in Turbo Pascal.
 
C

Chuck

It's been a (long, long) while since I looked at Turbo Pascal, but I thought
it used what Fortran (also been a long, long while since I looked at this
also) used for powers... the double asterisk symbol. I would have thought
your VB example of X^A would have been X**A in Turbo Pascal.

It's possible. I never tried that. Would "A" have to be an integer? What I
did was to look at the source code for a program that I knew raised numbers to
non integer powers: X^2.1342. That program used the natural log function. I
still think that some version of BASIC does not use ^. Wasn't there a version
of BASIC that could compile the code to an .exe file?

Over time I wrote programs in 8 to 10 different versions of BASIC. Programs
written in one version would not run in another. The strangest case was when
we up graded a HP computer to the next model (like model 1 to model 2) and the
code written in the model 1 would not run in model 2. It was usually a just
single command. You just had to find what and where.
 
J

jlute

Thanks everybody! I realized the T "alias" shortly after I posted this
but poor internet connections prohibited my response.

I appreciate the info!
 
R

Rick Rothstein

It's been too long since I played with languages that used ** for powers,
but my recollection is that A could be a floating point value.
 
Top