0

I used this function

=RIGHT(D2,
   LEN(D2) - 
      MAX(
        IF(ISNUMBER(MID(D2, ROW(INDIRECT("1:"&LEN(D2))), 1) *1)=FALSE,
            ROW(INDIRECT("1:"&LEN(D2))), 
           0
        )
     )
 ) 

to remove only the right most numbers from a string mixed of letters, special characters, and numbers. I am trying to do some basic calculations with the values of the new column however the SUM function is only returning 0

I have tried with the data being General and Number, I have also tried using Text to column solution but they both don't seem to work

4
  • 1
    Your formula returns result as text. If you want to do calculation with returned numbers, wrap your formula with VALUE() or add +0 at the end or multiply everything by 1 to convert it to number Commented Dec 11, 2023 at 21:32
  • Quick Add on if some of the cells were blank as there are no number at the end of the string for the Right function to find. How would I turn those blanks into 0 Commented Dec 11, 2023 at 22:16
  • 1
    there is no sum function in your formula. Please post the formula you actually use. Commented Dec 11, 2023 at 22:36
  • 1
    Can you provide an example of what the image or string text looks like? Commented Dec 12, 2023 at 4:23

1 Answer 1

1

This modified formula will extract the rightmost numbers from the string and convert them to numeric values in a single step.

=VALUE(RIGHT(D2,
   LEN(D2) - 
      MAX(
        IF(ISNUMBER(MID(D2, ROW(INDIRECT("1:"&LEN(D2))), 1) *1)=FALSE,
            ROW(INDIRECT("1:"&LEN(D2))), 
           0
        )
     )
 ))
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.