logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
zentex  
#1 Posted : Monday, December 6, 2010 1:32:01 AM(UTC)
zentex

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/16/2010(UTC)
Posts: 2

I have the following variables in a formula x5:=MOV(C,5,S); x10:=MOV(C,10,S); x15:=MOV(C,15,S); x20:=MOV(C,20,S) I would like the formula to find the variable which has the maximum value and return the coressponding period. For example if x10 is the maximum within x5,x10,x15 and x20, I would like the formula to return the value 10. How do I achieve this? Thanks in advance.
wabbit  
#2 Posted : Monday, December 6, 2010 2:59:31 AM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Nested Max() functions.

max(max(x,y),z) etc



wabbit [:D]

zentex  
#3 Posted : Monday, December 6, 2010 11:15:23 AM(UTC)
zentex

Rank: Newbie

Groups: Registered, Registered Users, Subscribers
Joined: 9/16/2010(UTC)
Posts: 2

Thanks Wabbit!
henry1224  
#4 Posted : Monday, December 6, 2010 11:38:29 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4 /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin-top:0in; mso-para-margin-right:0in; mso-para-margin-bottom:10.0pt; mso-para-margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:"Calibri","sans-serif"; mso-ascii-font-family:Calibri; mso-ascii-theme-font:minor-latin; mso-fareast-font-family:"Times New Roman"; mso-fareast-theme-font:minor-fareast; mso-hansi-font-family:Calibri; mso-hansi-theme-font:minor-latin;}



x5:=MOV(C,5,S);
x10:=MOV(C,10,S);
x15:=MOV(C,15,S);
x20:=MOV(C,20,S);

If(x5=max(x5,max(x10,max(x15,x20))),5,

If(x10=max(x5,max(x10,max(x15,x20))),10,

If(x15=max(x5,max(x10,max(x15,x20))),15,

If(x20=max(x5,max(x10,max(x15,x20))),20,0))));

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.