What is the formula in excel to show the result below
Example: 049-054 and the result 6
Thank you..
What is the formula in excel to show the result below
Example: 049-054 and the result 6
Thank you..
R
Your question is unclear so my Answer has some alternatives,
If cell A3 contains 049-054 (as your file does) and that represents a series of numbers, then the count of numbers in that series is obtained using the text manipulation functions LEFT and RIGHT as follows:
=RIGHT(A3,3)-LEFT(A3,3)+1
That extracts the 3 digits at the end of the string and subtracts those at the start then adds 1 to get the number of items (e.g. 049-054 gives 6 and 072-072 would give 1).
It assumes that the larger number is always at the end of the string. If not, you could use what follows...
You can use Excel's ABSOLUTE function (ABS) to return the absolute value of a number. That converts negative numbers to positive numbers (while positive numbers remain the same).
If cell A1 is 49 and A2 is 55, then:
=ABS(A1-A2)
will give 6.
If both are strings (like '049) then use:
=ABS(VALUE(A1) -VALUE(A2))