Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bill Brehm
 
Posts: n/a
Default reference a function

Can I do something like this?

A B
1 =F(A1)
2 =F(A2)
3 =F(A3)
4 etc
5
6
7
8
9
10

and define a function in a cell called F, say maybe =sin(X)? This would give
me the ability to plot any function I can put in a cell.


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Ardus Petus
 
Posts: n/a
Default reference a function

You will have to calulate the various functions in separate columns, then
use INDIRECT to reference the desired column.
See example: http://cjoint.com/?dqi70Wzv3V

HTH
--
AP

"Bill Brehm " <<don't want any spam a écrit dans le message de
...
Can I do something like this?

A B
1 =F(A1)
2 =F(A2)
3 =F(A3)
4 etc
5
6
7
8
9
10

and define a function in a cell called F, say maybe =sin(X)? This would

give
me the ability to plot any function I can put in a cell.




  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg
 
Posts: n/a
Default reference a function

=CHOOSE(my_func,SIN(table),COS(table),TAN(table))
Select which function you want by setting
a cell named my_func to 1, 2 or 3 (max is 29).

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bill Brehm
 
Posts: n/a
Default reference a function

What do you mean by 'table' here? is it referring to Ardus Petus'
suggestion?

I was trying to look for a way to put a perhaps complicated function in only
one cell rather than in every cell in the range covered by the range of
arguments. I know I can do it with VB but looking for a way to do it on the
spreadsheet only.

Could array formulas be of any help?


"Herbert Seidenberg" wrote in message
oups.com...
=CHOOSE(my_func,SIN(table),COS(table),TAN(table))
Select which function you want by setting
a cell named my_func to 1, 2 or 3 (max is 29).



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Harlan Grove
 
Posts: n/a
Default reference a function

Bill Brehm wrote...
Can I do something like this?

A B
1 =F(A1)
2 =F(A2)
3 =F(A3)
4 etc

....
and define a function in a cell called F, say maybe =sin(X)? This would give
me the ability to plot any function I can put in a cell.


The closest would be a udf like

Function F(a As Variant) As Variant
Dim fcn As String
Application.Volatile True
fcn = Evaluate("_F")
fcn = Replace(fcn, "$$", CStr(a))
F = Evaluate(fcn)
End Function

where _F would be a defined name referring to the actual function you
wanted to use, and $$ would be the token representing the argument to
F(). Note: you can't have both a udf named F and a defined name named F.



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Herbert Seidenberg
 
Posts: n/a
Default reference a function

Assuming your data looks like this:
table results
0.00 0.00
0.15 0.15
0.31 0.30
0.46 0.44
.... ...
5.98 -0.30
6.13 -0.15
6.28 0.00

my_func
1

Table is the named range of numbers from 0.00 to 6.28
Select these numbers and
Insert Name Define Names in Workbook table
In the same manner, give the cell with the 1 the name my_func
Fill the <results column with the formula given in the previous post.
The column <results will now display the sine terms.
You can now plot the first column (radians) vs the second (x y plot).
To display the cosine, type in 2 in the my_func cell.
Now let's add an arbitrary fourth function, a quadratic.
Add Quad to the formula:
=CHOOSE(my_func,SIN(table),COS(table),TAN(table),Q uad)
Add this name to Names in Workbook Quad
Refers to =0.58*table^2-1.78*table+2.34
Type 4 into my_func and the quadratic curve will appear in your graph.

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
Reference Cell if Found in a IF function A Stevens Excel Worksheet Functions 2 December 25th 05 05:27 PM
How can I reference a cell as the criteria in a count if function. RobA Excel Discussion (Misc queries) 1 August 17th 05 06:41 PM
Lookup function returning reference, not value Caligula Excel Worksheet Functions 1 May 28th 05 06:35 PM
clock Wildman Excel Worksheet Functions 2 April 26th 05 10:31 AM
Dynamic Function Reference Question excel newbie Excel Discussion (Misc queries) 1 April 20th 05 08:09 PM


All times are GMT +1. The time now is 11:18 AM.

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"