Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X
I am tring to set the starting value of the summation as below. Prime 8 file attached.
Want to be able to set k=r or k=0.
Solved! Go to Solution.
Try to avoid using all uppercase letters in your subject as this is considered loud shouting/screaming and there is no reason to do so here.
Are you looking for a function with the argument specifying that starting value of k or do you just want to set a worksheet variable and want the calculation be done dependent on this variable.
In the latter case you may simply define a variable start to be either 0 or 1 and setup the sum to start with k=r*start.
Furthermore its not necessary to use any loop! Your for-loops just returns the last result (for j = count) and discards all the previous ones. So you may simply use count in your sum instead or r.
EDIT: And here is the version with a function (as before the argument "st" is either 0 or 1):
Additional remark/question:
Why do you setup these as functions in t? None of them is dependent on t!!! The result is the same vector no matter which function argument you provide when you call these functions. So they could as well be variables instead of functions.
Try to avoid using all uppercase letters in your subject as this is considered loud shouting/screaming and there is no reason to do so here.
Are you looking for a function with the argument specifying that starting value of k or do you just want to set a worksheet variable and want the calculation be done dependent on this variable.
In the latter case you may simply define a variable start to be either 0 or 1 and setup the sum to start with k=r*start.
Furthermore its not necessary to use any loop! Your for-loops just returns the last result (for j = count) and discards all the previous ones. So you may simply use count in your sum instead or r.
EDIT: And here is the version with a function (as before the argument "st" is either 0 or 1):
Additional remark/question:
Why do you setup these as functions in t? None of them is dependent on t!!! The result is the same vector no matter which function argument you provide when you call these functions. So they could as well be variables instead of functions.