How to replace / substitute THE LAST OCCURRENCE of a character in a string ?
Hello,
I’m in NUMBERS 13.1 on MacOS 12.6.6 (but it’s not a version issue).
I have several values with different lengths in column B, e. g.: B6 : 56:01:59
And I want to REPLACE or SUBSTITUTE THE LAST OCCURRENCE of ":" by "," in order to return the following value instead in C6 : 56:01,59
i. e. : having the last digits after the comma identified as milliseconds.
I tested different formulas in column C. e.g. : C6 : REPLACE(B6;”:";",";2)
It’s returning 56:01,59 which is correct, but wouldn’t work with a longer string ( WRONG 00:00,00:00 ).
Select-Replacing the FIRST OCCURRENCE (start counting from LEFT) seems easier than Select-Replacing THE LAST OCCURRENCE of the ":".
How can I Select-Replace THE LAST OCCURENCE of ":" in a formula for cells with different string-lengths ? and
How would a nested Formula look like, using REPLACE/SUBSTITUTE and RIGHT, in oder to invert the count-direction ?
2023-11-02_TABLE-EXCERPT_REPLACE_FROM_RIGHT_OR_LAST_OCCURRENCE-ISSUE.53.1.png
/ How does the NUMBERS formula look like, assuming working with either :
a) a « REPLACE Last Occurrence Of ”:” » approach, or
b) a « REPLACE First Occurrence from RIGHT » approach
?
Any help much appreciated
:)