ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Passing Variable to LINEST (https://www.excelbanter.com/excel-worksheet-functions/27404-passing-variable-linest.html)

RW

Passing Variable to LINEST
 
I am using the following formula:
=SUM(LINEST(A$3:A$6, B$3:B$6)*{61590,1})

I need to use a value from a cell rather than typing the value (61590 in the
above equation) into the formula each time. I have tried using quotes,
parentheses, brackets, etc. without any luck.

I am using Excel 2002. How is this done?

Thanks

Max

Perhaps try, array-entered
(i.e. press CTRL+SHIFT+ENTER):

=SUM(LINEST(A$3:A$6,B$3:B$6)*D2:E2)

where D2 will house: 61590 (say)
and E2 will contain: 1
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"RW" wrote in message
...
I am using the following formula:
=SUM(LINEST(A$3:A$6, B$3:B$6)*{61590,1})

I need to use a value from a cell rather than typing the value (61590 in

the
above equation) into the formula each time. I have tried using quotes,
parentheses, brackets, etc. without any luck.

I am using Excel 2002. How is this done?

Thanks




Max

Maybe better to make the cell refs (D2:E2) absolute,
in case you're copying across, so try instead, array-entered:
=SUM(LINEST(A$3:A$6,B$3:B$6)*$D$2:$E$2)
Adapt to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----



RW

Thanks!!

"Max" wrote:

Maybe better to make the cell refs (D2:E2) absolute,
in case you're copying across, so try instead, array-entered:
=SUM(LINEST(A$3:A$6,B$3:B$6)*$D$2:$E$2)
Adapt to suit ..
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----




Max

You're welcome !
--
Rgds
Max
xl 97
---
GMT+8, 1° 22' N 103° 45' E
xdemechanik <atyahoo<dotcom
----
"RW" wrote in message
...
Thanks!!




Harlan Grove

Max wrote...
Perhaps try, array-entered
(i.e. press CTRL+SHIFT+ENTER):

=SUM(LINEST(A$3:A$6,B$3:B$6)*D2:E2)

....

Better still would be using SUMPRODUCT.

=SUMPRODUCT(LINEST(A$3:A$6,B$3:B$6),D2:E2)

However, if the E2 value were always 1 (for the constant term from the
regression coefficients), it'd make more sense to use TREND or
FORECAST.

=TREND(A$3:A$6,B$3:B$6,D2)

=FORECAST(D2,A$3:A$6,B$3:B$6)

You can drive screws with hammers and pound nails with screwdrivers,
but should you?



All times are GMT +1. The time now is 01:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com