Extracting Text

ejsifuen1124

New Member
Joined
Dec 21, 2019
Messages
3
Office Version
  1. 2019
Platform
  1. Windows
I try to stay away from asking questions on this forum as much as possible but I would really appreciate help on finding a solution to a problem!

I'm looking to extract the numbers (one, two or three digits) between certain text/characters. Example assuming the cell is A2:

1614982387027.png


The formulas would go cells C2:E5 in this example, while extracting the number that corresponds with the table header (row 1) with the information in column A.

I hope this makes sense and thanks in advance!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
Hi,

Use B2 formula, result is Text, in case you have leading 0 values that you want kept intact (e.g. 012, 005, etc.)
Use G2 formula, result converted to Real numbers, easier for further math/comparisons.

Book3.xlsx
ABCDEFGHIJ
1CAABAC
2C-76,A-2,AB-3,AC-10076231007623100
3AB-1,C-100,AC-2100 12100 12
4AC-3,C-100100  3100  3
5C-3232   32   
Sheet828
Cell Formulas
RangeFormula
B2:E5B2=IFERROR(TRIM(LEFT(SUBSTITUTE(MID(","&$A2,FIND(","&B$1&"-",","&$A2)+2+LEN(B$1),255)&",",",",REPT(" ",99)),99)),"")
G2:J5G2=IFERROR(LEFT(SUBSTITUTE(MID(","&$A2,FIND(","&B$1&"-",","&$A2)+2+LEN(B$1),255)&",",",",REPT(" ",99)),99)+0,"")
 
Upvote 0

Forum statistics

Threads
1,214,641
Messages
6,120,694
Members
448,979
Latest member
DET4492

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