Forum Discussion
Formulas and functions
Your example, Nick, is VERY specific. So I'm going to assume that you're wanting this to work with what we might call traditional fractional notation. IF that's the case, then here's a formula that doesn't require VBA to work.
=VALUE(LEFT(A1,FIND("/",A1)-1))/VALUE(RIGHT(A1,LEN(A1)-FIND("/",A1)))
This finds the value of whatever text in cell A1 precedes the "/" character, and divides that by the value of whatever text follows the "/" character. It uses the text manipulation functions LEFT and RIGHT to determine the relevant text, FIND and LEN to count the characters as needed, and then VALUE to convert text to value.
As this image shows, because it's dependent on the location of the "/" character, it will work with more complex fractions as well.
But if you want a function to work with other kinds of numbers in text, then let me invite you to be a bit more expansive on your description of what you're seeking to accomplish.
- Nick_DoddSep 26, 2021Copper ContributorThanks for your response. I'm not able to try it this week as I am on holiday, but will give it a whirl next week.
Yours
Nick Dodd