=IF(ISERROR(N23/F23),0,IF(ABS(N23/F23)>10,"NM",IF(AND(N23>0,(N23/F23)<0),-N23/F23,IF(AND(N23<0,(N23/F23)>0),-N23/F23,N23/F23))))
word by word for each of the ISERROR, 0, IF(ABS... etc. Thank you.
=IF(ISERROR(N23/F23),0,IF(ABS(N23/F23)>10,"NM",IF(AND(N23>0,(N23/F23)<0),-N23/F23,IF(AND(N23<0,(N23/F23)>0),-N23/F23,N23/F23))))
word by word for each of the ISERROR, 0, IF(ABS... etc. Thank you.
Have you checked the syntax of the different functions used?
E23=6156 F23=6169 N23=13 (6169-6156). That formula is put into column O to yield 0.21%
but I could've easily done =(F23/E23)/E23 to yield 0.21% as well. Why did someone have to make the formula that long?
liur3n,
That formula says the following (reading from left to right):
If N23/F23 results in an error, then output 0
Else if the absolute value of N23/F23 is greater than 10, then output "NM"
Else if N23 is greater than 0 and N23/F23 is less than 0, then output -N23/F23
Else if N23 is less than 0 and N23/F23 is greater than 0, then output -N23/F23
Else output N23/F23
Basically, if the cell F23 = 0 (which would cause an error, as anything divided by 0 results in "#DIV/0"), the formula returns 0 (to avoid the error)
Then the formula checks if the division would result in a value higher than 10 (regardless of if the value is positive or negative), and if so, the formula returns "NM"
Then, the formula checks the sign of the numerator (N23), and makes the formula result the same sign, so if the numerator is positive, the result is positive, or if the numerator is negative, the result is negative.
Hope that helps,
~tigeravatar
Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks