PC Review


Reply
Thread Tools Rate Thread

Complex functions

 
 
JP Ronse
Guest
Posts: n/a
 
      18th Apr 2010
Hi All,

Suppose you have a very complex and long function that is also subject to a
condition, then you will/can have something like:

=if(condition(complex function), complex function, other complex function)

It can have more lines in the formula bar, so readability below 0 Kelvin.

Is there a way to 'name' a function?

=If(condition(myfunc = complex function), myfunc, other complex function)




With kind regards,

JP


 
Reply With Quote
 
 
 
 
Bernard Liengme
Guest
Posts: n/a
 
      18th Apr 2010
All names in the sense you are using it are actually functions.
Thus if I select a cell (say B2) and type VAT in the Name box and press
Enter (or name that cell in any other way), I get something like =Sheet1!B2
when I use Names | Paste List. So you see VAT in the name of a function ---
its definition begins with an = sign

Here is an example of a name using other names. A2 is given the name a, and
b2 the name b
Then I define a function called myfun1 as being ==(a>b)*5+(b>a)*11
In any cell (not A2 or B2), I type =myfun1 and it will return either 5 or 11
I could have defined the function as =IF(a>b,5,11) and got the same result

Have a go and come back to this thread if more help is needed
best wishes
--
Bernard Liengme
Microsoft Excel MVP
http://people.stfx.ca/bliengme

"JP Ronse" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> Hi All,
>
> Suppose you have a very complex and long function that is also subject to
> a condition, then you will/can have something like:
>
> =if(condition(complex function), complex function, other complex function)
>
> It can have more lines in the formula bar, so readability below 0 Kelvin.
>
> Is there a way to 'name' a function?
>
> =If(condition(myfunc = complex function), myfunc, other complex function)
>
>
>
>
> With kind regards,
>
> JP
>

 
Reply With Quote
 
JP Ronse
Guest
Posts: n/a
 
      20th Apr 2010
Hi Bernard, P45Cal,

Thanks both for your input.

This gives indeed some nice features to write readable functions. I'm going
to play with it.


With kind regards,

JP



"p45cal" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
>
> Further to my last post on this, as an example, say you wanted a
> function to work out the length of the long side of a right-angled
> triangle knowing the the lengths of the two shorter sides, using
> Pythagoras (the squaw of the hippopotamus is equal to the sons of the
> squaws of the other two hides).
> Just as a for instance, say you had two cells, left and right, each
> containing the length of the shorter side and you wanted the length of
> the long side to the right of both cells.
> To get the formula right, compose it on a worksheet first. At random I
> put the two shorter lengths values in cells B26 and C26 and developed
> the formula in D26:
> =SQRT(B26^2+C26^2)
> A quick test with 3 and 4 as the two shorter lengths gives correctly
> 5.
> Now copy this formula to the clipboard, AND WITH CELL D26 STILL THE
> ACTIVE CELL, go into Insert|Names|Define Names (Name Manager in the
> Defined Names section of the Formulas tab in the xl2007 ribbon) and
> create a new Name, call it HYPOTENUSE and then paste in the formula from
> the clipboard into the RefersTo: field. OK out of this dialogue box.
> Back on the worksheet, you can type
> =Hypotenuse
> into any cell and it will try and return the length of the calculation
> using the two cells to its left.
>
> I was surprised to see J Walkenbachs 2002 Power Programming book here:
> http://tinyurl.com/y24qhol
> where he says this on naming formulas:
> --Besides naming cells, ranges, and constants, you can also enter a
> formula directly into the Refers to box in the Define Name dialog box to
> create a named formula. The formula that you enter uses cell references
> relative to the active cell-the cell that receives the formula. If you
> use the mouse to indicate related cells in the act of building a
> formula, however, the references will be absolute.
> Figure 3-4 shows a formula (=A1^B1) entered directly in the Refers to
> box in the Define Name dialog box. In this case, the active cell is C1,
> so the formula refers to the two cells to its left (notice that the cell
> references are relative). After this name is defined, entering =Power
> into a cell raises the value two cells to the left to the power
> represented by the cell directly to the left. For example, if B10
> contains 3 and C10 contains 4, entering the following formula into cell
> D10 will return a value of 81 (3 to the 4th power):
> =Power
> Figure 3-4: You can name a formula that doesn't appear in any worksheet
> cell.
> When you call up the Define Name dialog box after creating the named
> formula, you'll find that the Refers to box displays a formula that is
> relative to the active cell.
> For example, if cell D32 is active, the Refers to dialog box will
> display:
> =Sheet1!B32^Sheet1!C32
> Notice that Excel appends the worksheet name to the cells references
> used in your formula. This, of course, will cause the named formula to
> produce incorrect results if you use it on a worksheet other than the
> one in which it was defined. If you would like to use this named formula
> on a sheet other than Sheet1, you'll need to remove the sheet references
> fromthe formula (but keep the exclamation points). For example:
> =!A1^!B1
> After you understand the concept, you may discover some new uses for
> named formulas. One distinct advantage is apparent if you need to modify
> the formula. You can just change the definition in the Name Box rather
> than edit each occurrence of the formula.--
>
>
> --
> p45cal
>
> *p45cal*
> ------------------------------------------------------------------------
> p45cal's Profile: http://www.thecodecage.com/forumz/member.php?u=558
> View this thread:
> http://www.thecodecage.com/forumz/sh...d.php?t=196469
>
> http://www.thecodecage.com/forumz
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I create complex functions? =?Utf-8?B?Q2hyaXM=?= Microsoft Excel Worksheet Functions 2 1st Nov 2004 12:28 AM
Complex IF Functions Berlinetta Microsoft Excel Worksheet Functions 0 24th Sep 2004 12:55 AM
Complex IF Functions Berlinetta Microsoft Excel Worksheet Functions 2 23rd Sep 2004 04:43 PM
Complex IF Functions Berlinetta Microsoft Excel Worksheet Functions 1 23rd Sep 2004 06:41 AM
Complex IF Functions Berlinetta Microsoft Excel Worksheet Functions 4 22nd Sep 2004 10:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:15 PM.