W.r.t. my earlier thread posted earlier today, I feel that I have solved the problem at least partially. It primarily involves checking if the given value is the minimum OR maximum absolute value among the data set, checking the sign convention and then some basic arithmetic operations.
Assuming 3 random values in cells A1 to C1 , I am able to select the min and max numbers with the following formulae :
MIN =INDEX(A1:C1,MATCH(MIN(ABS(A1:C1-"0")),ABS(A1:C1-"0"),0))
MAX =INDEX(A1:C1,MATCH(MAX(ABS(A1:C1-"0")),ABS(A1:C1-"0"),0))
How this works is that this essentially reduces the number from which the closest number is to be ascertained, in our case "0", takes the absolute value and then uses the match and index functions to bring back the value of that min/max number.
Now, I intend on developing the following chain of logic but somehow I cannot get the syntax to work.
If(sign(MAX value)<>sign(MIN value) AND A1=(MAX value), A+(MIN value) ,if(sign(MAX value)<>sign(MIN value) AND A1=(MIN value),0,A1)
The above means:
If the sign of the max value and min value are opposite and A1 is the MAX value, then set off the MAX value with the MIN value.
If the sign of the max value and min value are opposite and A1 is the MIN value, then reduce the MIN value to 0.
If the value is neither of the two, then hold on to the same original value.
Some help with the final working syntax of the above logic would be greatly appreciated. Also, any shorter and smarter logic would be very welcome.
Thanks
A
Bookmarks