Removing all characters to the right of a string in a cell

Banditeb

New Member
Joined
May 18, 2015
Messages
12
I have a cell that contains 2/1/18..2/28/18 and I would like to remove everything to the right of the .. including the .. so my new cell would be only 2/1/18

I can not do it by removing a number of characters because I have instances with more characters (ie: 12/1/18..12/31/18)

Appreciate the help.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
You could try:

=IFERROR(LEFT(A1,FIND("..",A1)-1),A1)
Rather than checking for an error and returning A1 when there is an error (returns 0 if A1 is blank by the way), giving it ".." to find is probably a better way do it (returns "" for a blank A1)...

=LEFT(A1,FIND("..",A1&"..")-1)
 
Upvote 0
I just see that as a different way rather than a better way if im honest. They handle the fact that no ".." is found in a different way. Its easy to mitigate the 0 result if so desired isnt it.
 
Upvote 0
I just see that as a different way rather than a better way if im honest. They handle the fact that no ".." is found in a different way. Its easy to mitigate the 0 result if so desired isnt it.
The reason I said "is probably a better way" (note the word "probably") is because my formula has one less function call than the formula you posted... to mitigate the 0 would add yet another function call to your formula.
 
Upvote 0

Forum statistics

Threads
1,215,471
Messages
6,125,000
Members
449,202
Latest member
Pertotal

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