Extract name from cell

Josu

New Member
Joined
Mar 2, 2021
Messages
39
Office Version
  1. 2010
Platform
  1. Windows
Basically I am confused, not sure if this is even possible
For example we have such text in cell A1
TEST/1of3, to get test I can use formula =LEFT(A1,FIND("/",A1)-1)
But this cell A1 can look also
TEST 1of3, and formula returns #Value error.
Is it possible to make formula to check this 2 conditions, and give in the end this "test"(can be much more characters longer) as result?
I need extract text before /1 of 3 or xx 1 of 3
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You may need to enter with Ctrl+Shift+Enter in Excel 2010.
Book1
AB
1TEST/1of3TEST
2TEST 1of3TEST
Sheet1
Cell Formulas
RangeFormula
B1B1=LEFT(A1,FIND("|",SUBSTITUTE(SUBSTITUTE(A1," ","|",1),"/","|",1))-1)
B2B2=LEFT(A2,FIND("|",SUBSTITUTE(SUBSTITUTE(A2," ","|",1),"/","|",1))-1)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0
You may need to enter with Ctrl+Shift+Enter in Excel 2010.
Book1
AB
1TEST/1of3TEST
2TEST 1of3TEST
Sheet1
Cell Formulas
RangeFormula
B1B1=LEFT(A1,FIND("|",SUBSTITUTE(SUBSTITUTE(A1," ","|",1),"/","|",1))-1)
B2B2=LEFT(A2,FIND("|",SUBSTITUTE(SUBSTITUTE(A2," ","|",1),"/","|",1))-1)
Press CTRL+SHIFT+ENTER to enter array formulas.
Thanks a lot, any chance to have more symbols added to this formula? like for example "-", or "\", I am a bit dumbo, when I try to change give me too many arguments error
 
Upvote 0
Like this..
Book1
AB
1TEST/1of3TEST
2TEST 1of3TEST
3TEST-1of3TEST
4TEST\1of3TEST
Sheet1
Cell Formulas
RangeFormula
B1:B4B1=LEFT(A1,FIND("|",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1," ","|",1),"/","|",1),"-","|"),"\","|"))-1)
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 1
Solution
Like this..
Book1
AB
1TEST/1of3TEST
2TEST 1of3TEST
3TEST-1of3TEST
4TEST\1of3TEST
Sheet1
Cell Formulas
RangeFormula
B1:B4B1=LEFT(A1,FIND("|",SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(A1," ","|",1),"/","|",1),"-","|"),"\","|"))-1)
Press CTRL+SHIFT+ENTER to enter array formulas.
So complicated, cant track where is start, where is end
Thank you very much!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,185
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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