Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
jonathon wycherley
 
Posts: n/a
Default how do i do an inline function like in matlab

in excel i want to be able to type in a equation ie y=2x then in another cell
refer to and use this as a formula to do a calculation. but when you change
the equation the formula in the claculation changes to the new equation like
in matlab the inline function
  #2   Report Post  
Art
 
Posts: n/a
Default

You might consider named cells.

Example:

put 2 in A1. Then name A1 as x. (insert, name, define -- or just type x in
the "name box" when cell A1 is selected.
Next put =2*x in cell A2. Name it y.
Now you can write another equation referencing x or y anywhere you like.

Be careful of something. You can't give your cells valid cell references as
names. For example, you can't name a cell A5 or BA12.

Art


  #3   Report Post  
 
Posts: n/a
Default

Hi

I am not familiar with matlab at all, and I am fairly new
to Excel - but I think to do what you want to do would
require you to inplement some quite funky code. Also I am
assuming that y would be the cell showing the result, and
x is an input variable of some kind. I think you would
end up having to create a function "ParseAndCalc
(InputFormula, variableX, VariableY, Variable.....)

In your function you would then need to parse out the
operators and wite equivalent functions for +-/^ etc and
then figure out which variables to pass to them, figure ot
what is a literal value and pass this around - all a lot
of fun to do! THough givcen my relative newbie-ness there
may be another far simpler way someone else can suggest.
  #4   Report Post  
Frank Kabel
 
Posts: n/a
Default

Hi
Excel is not designed for such things. This would require some VBA coding,
etc.

--
Regards
Frank Kabel
Frankfurt, Germany

jonathon wycherley wrote:
in excel i want to be able to type in a equation ie y=2x then in
another cell refer to and use this as a formula to do a calculation.
but when you change the equation the formula in the claculation
changes to the new equation like in matlab the inline function



  #5   Report Post  
hrlngrv - ExcelForums.com
 
Posts: n/a
Default

Frank Kabel wrote...
Excel is not designed for such things. This would require some

VBA
coding, etc.

...

Inline functions would require some rather sophisticated VBA coding to
ensure that parsing worked correctly, and there are very few
respondents in these newsgroups who have any experience writing
lexical analyzers or parsers who could provide support in
development.

Better to be more forthright: Excel can't do this without a lot of
agonizing programming, and even then the results will be less than
satisfactory. If the OP wants math software functionality, the OP
should use math software, not Excel. Perhaps siag (a linux/unix
spreadsheet implemented in Scheme, this the name - Scheme In A Grid)
would provide this, but it's the only one I can think of that might
be able to.
---------
www.coffeecozy.com

Use your Bodum and give up cold coffee for good!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formula to list unique values JaneC Excel Worksheet Functions 4 December 10th 04 12:25 AM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM
Find a Function to use accross different worksheets R. Hale Excel Worksheet Functions 3 November 25th 04 07:07 AM
change function variable prompts?? thinkingfield Excel Worksheet Functions 1 November 8th 04 04:01 PM
Counting Function Dilemma Simon Lloyd Excel Worksheet Functions 0 November 8th 04 03:13 PM


All times are GMT +1. The time now is 05:06 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"