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

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
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,215,196
Messages
6,123,575
Members
449,108
Latest member
rache47

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