0

Does anyone knows any formula to extract the number with separation (dot, comma) from cell A1 to cell B1?

Example, I want to extract 2,590.00 from cell A1 which has the following value:

[sum: 2,590.00]

I got the formula below that works nice, however is just getting all numbers e.g. 259000

{=TEXTJOIN("",TRUE,IFERROR((MID(A1,ROW(INDIRECT("1:"&LEN(A1))),1)*1),""))}

I appreciate every support

David Leal
  • 6,373
  • 4
  • 29
  • 56

2 Answers2

1

You can use a formula like as below:

enter image description here

• Formula used in cell B1

=MAX(IFERROR(--MID(SUBSTITUTE(A1,"]",""),ROW($ZZ1:INDEX($ZZ:$ZZ,LEN(A1))),LEN(A1)),0))

• With OFFICE 365, you can try this in cell C1

=--INDEX(TEXTSPLIT(A1,{":","[","]"},,1),,2)

• Formula used in cell D1

=SUBSTITUTE(TEXTAFTER(A1," "),"]","")*1
Mayukh Bhattacharya
  • 12,541
  • 5
  • 21
  • 32
  • 1
    @DavidLeal post edit doesn't shows that, it was from the beginning, never mind, I don't post solutions without OP query history. Furthermore, OP has never accepted anyone's solution yet, which surprises more isnt it weird. – Mayukh Bhattacharya Oct 26 '22 at 23:15
  • Mayukh. No all changes are reflected in the history there is a grace period. I don’t know the duration of this grace period. During this period changes are not reflected in the history. I hope @DavidNunes will solve the mistery, :-). Anyway good talking to you. – David Leal Oct 26 '22 at 23:32
1

Under O365 you can try the following in cell B1 which is a very concise approach:

=TEXTAFTER(TEXTBEFORE(A1,"]"), "sum: ")

Here is the output:

sample excel file

For , similar idea but using SUBSTITUTE instead to remove the prefix ([sum: ) and the suffix (]):

=SUBSTITUTE(SUBSTITUTE(A1,"[sum: ",""),"]","")
David Leal
  • 6,373
  • 4
  • 29
  • 56