get numbers between 2 chars second char not always the same

pencil pusher

New Member
Joined
Feb 24, 2016
Messages
11
I am trying to get the numbers in between the "+" from data, except if there is a "(" then I want only the numbers between the "+" and the "("

here is an example of the data

5215983+14(BH)+XZD
5215983+13+DFG
0896458+2(YZ)+XZD
5215983+10+XZD
9874289+14+XZD
5215983+8+XZD
5215983+7(HF)+YZD
31531+33+bbb
3135111355+34(be)+dez



The formula that I am using so far is getting this...
14(BH)
13
2(YZ)
10
14
8
7(HF)
33
34(be)


This is what I want
14
13
2
10
14
8
7
33
34

This is my formula

Code:
=MID(K5, FIND("+",K5)+1, FIND("+",K5, FIND("+",K5)+1)-FIND("+",K5)-1)
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
See if this does what you want.
Code:
=--TRIM(LEFT(SUBSTITUTE(TRIM(MID(SUBSTITUTE(A1,"+",REPT(" ",256)),256,256)),"(",REPT(" ",256)),256))
 
Upvote 0
This is shorter.
Code:
=--TRIM(MID(SUBSTITUTE(SUBSTITUTE(A1,"+",REPT(" ",256)),"(",REPT(" ",256)),256,256))
 
Upvote 0

Forum statistics

Threads
1,215,474
Messages
6,125,024
Members
449,204
Latest member
LKN2GO

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