Text Between Two Delimiters?

Rachel_RBC

New Member
Joined
Jun 2, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello,
I have a mess of a formula that I'm having trouble figuring out where I'm missing arguments. I also wonder if this is the best/easiest way to accomplish this.

I want to return the text between two delimiters, the first "~", and then "^_^". In the below sample Data, I want to it to return 5lb. All of our data should have the delimiters, but I would like to account for my coworkers possibly not following directions when this input data is created on another app.

Sample Data (Cell D21 on 'Input' sheet):
--start--
Source: Justin Goldman

~

5lb

^_^

High value item!
--end--

My messy formula: =IFERROR(IF(Input!D21="","",TEXTAFTER(iferror(TEXTBEFORE(Input!D21,"^_^"),textafter(Input!D21,"~")),"~"),"Not Given")
Right now I get an error for too few arguments, I believe. The tool tips stopped showing up.

Any help is greatly appreciated!
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
this works
=IF(D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(D21,"^_^"),TEXTAFTER(D21,"~")),"~"))
you may be missing )

i have just removed the INPUT! for simplicity to show here

=IFERROR(IF(input!D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(input!D21,"^_^"),TEXTAFTER(input!D21,"~")),"~")),"not given")


Book1
ABCD
1 5lb
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21--start-- Source: Justin Goldman ~ 5lb ^_^ High value item! --end--
Sheet4
Cell Formulas
RangeFormula
A1A1=IFERROR(IF(D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(D21,"^_^"),TEXTAFTER(D21,"~")),"~")),"not given")
 
Upvote 0
Solution
this works
=IF(D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(D21,"^_^"),TEXTAFTER(D21,"~")),"~"))
you may be missing )

i have just removed the INPUT! for simplicity to show here

=IFERROR(IF(input!D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(input!D21,"^_^"),TEXTAFTER(input!D21,"~")),"~")),"not given")


Book1
ABCD
1 5lb
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21--start-- Source: Justin Goldman ~ 5lb ^_^ High value item! --end--
Sheet4
Cell Formulas
RangeFormula
A1A1=IFERROR(IF(D21="","",TEXTAFTER(IFERROR(TEXTBEFORE(D21,"^_^"),TEXTAFTER(D21,"~")),"~")),"not given")

Thank you so much! That did the trick.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,196
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top