Shortening Name/Trim?

ardykav

Board Regular
Joined
Oct 18, 2015
Messages
172
Office Version
  1. 365
Platform
  1. Windows
Hi,

Currently i have a lookup that detects a tab name. However the tab names naming convention is First Name Surname Week 1 or First Name Surname Week 2

I just want to have the first name and surname and leave off the Week 2 part.

This is the current formula that i use

=IF(D2=0, "",INDIRECT("Controls!A" & H2))

What do i need to place in this for it to get the required result? I presume its Trim of some sort?

thanks
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You might consider incorporating a string function like Mid() or Left():


Excel 2010
ABC
1First Name Surname Week 1First Name SurnameFirst Name Surname
2First Name Surname Week 2First Name SurnameFirst Name Surname
3First Name Surname Week 3First Name SurnameFirst Name Surname
4First Name Surname Week 4First Name SurnameFirst Name Surname
5First Name Surname Week 5First Name SurnameFirst Name Surname
Sheet1
Cell Formulas
RangeFormula
B1=LEFT(A1,LEN(A1)-8)
C1=MID(A1,1,LEN(A1)-8)
 
Upvote 0
Thanks but that doesnt seem to work. I have a person named Alan Green Week 1 however when i use your formulas below both formulas produce the same result? What am I doing wrong?
You might consider incorporating a string function like Mid() or Left():

Excel 2010
ABC
First Name Surname Week 1First Name SurnameFirst Name Surname
First Name Surname Week 2First Name SurnameFirst Name Surname
First Name Surname Week 3First Name SurnameFirst Name Surname
First Name Surname Week 4First Name SurnameFirst Name Surname
First Name Surname Week 5First Name SurnameFirst Name Surname

<colgroup><col style="width: 25pxpx"><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]

[TD="align: center"]2[/TD]

[TD="align: center"]3[/TD]

[TD="align: center"]4[/TD]

[TD="align: center"]5[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]B1[/TH]
[TD="align: left"]=LEFT(A1,LEN(A1)-8)[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: #DAE7F5"]C1[/TH]
[TD="align: left"]=MID(A1,1,LEN(A1)-8)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

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