Jump to content
Sign in to follow this  
Stuart Taylor

Cant see the wood for the trees

Recommended Posts

I'm sure there is a very simple calculation to do this but for some reason i can't see it.

best

Stuart

Let ( [

//a = number from 1 to 5

a = 1 ;

//b = number from 1 to 5

b = 5 ] ;

Choose ( a ;

Choose ( b ; 00 ; 01 ; 02 ; 03 ; 04 )

Choose ( b ; -1 ; 00 ; 01 ; 02 ; 03 )

Choose ( b ; -2 ; -1 ; 00 ; 01 ; 02 )

Choose ( b ; -3 ; -2 ; -1 ; 00 ; 01 )

Choose ( b ; -4 ; -3 ; -2 ; -1 ; 00 )

)

)

ps the 00 are just to make it readable a simple number is all that needs to be returned.

Share this post


Link to post
Share on other sites

are you sure that's right? -- your missing the zero values in the choose statement.

i.e. Choose( 2 ; 0 ; 1; 2 ) will return 2

Choose( x ; result0 ; result1; result 2...)

Share this post


Link to post
Share on other sites

LOL

Its one of those days

Why must my brain do this to me sometimes.

I remember sitting at school aged 10 and spelling "a", "ay" and thinking i'm sure thats not right but i can't for the life of me work out why.

Share this post


Link to post
Share on other sites

Don't I know the feeling :)

Share this post


Link to post
Share on other sites

Out of curiosity, are you seeing this topic as:

Can't see the wood for the trees

Share this post


Link to post
Share on other sites

Did you actually type an apostrophe in or copy it from somewhere else?

Share this post


Link to post
Share on other sites

Well, i assume there is a difference between the topic and the body...

Anywho, was just curious.

Share this post


Link to post
Share on other sites

I can't get into my head why you do jump all these Choose( hoops when the entire thing can be written this way:

Right("0" & GetAsText(theB-theA);2)

:)

--sd

Share this post


Link to post
Share on other sites

see what your saying but although its not clear in the example the range could potentially be highter than 9.

don't think the solution could really be any simpler than b-a

best

Stuart

Share this post


Link to post
Share on other sites

Quote:

ps the 00 are just to make it readable a simple number is all that needs to be returned.

The original example (although functional) was illustrative.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.