ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If 5th character="-" delete everything to the left otherwise do no (https://www.excelbanter.com/excel-worksheet-functions/210054-if-5th-character%3D-delete-everything-left-otherwise-do-no.html)

Mike R.

If 5th character="-" delete everything to the left otherwise do no
 
Hi -
I can't seem to figure this out, I bet it is pretty easy. Can anyone assist?

The text is in A1.

Thanks,
Mike

Sheeloo[_3_]

If 5th character="-" delete everything to the left otherwise do no
 
Try
=IF(MID(A1,5,1)="-",RIGHT(A1,(LEN(A1)-5)),A1)

"Mike R." wrote:

Hi -
I can't seem to figure this out, I bet it is pretty easy. Can anyone assist?

The text is in A1.

Thanks,
Mike


John C[_2_]

If 5th character="-" delete everything to the left otherwise do no
 
You really should put your main question in the white box, not in the header.

=IF(LEN(A1)<5,A1,IF(MID(A1,5,1)="-",RIGHT(A1,LEN(A1)-5),A1))
--
** John C **


"Mike R." wrote:

Hi -
I can't seem to figure this out, I bet it is pretty easy. Can anyone assist?

The text is in A1.

Thanks,
Mike


Pete_UK

If 5th character="-" delete everything to the left otherwise dono
 
Try this:

=IF(MID(A1,5,1)="-",RIGHT(A1,LEN(A1)-5),A1)

Hope this helps.

Pete

On Nov 12, 3:55*pm, Mike R. wrote:
Hi -
I can't seem to figure this out, I bet it is pretty easy. *Can anyone assist?

The text is in A1.

Thanks,
Mike



David Biddulph[_2_]

If 5th character="-" delete everything to the left otherwise do no
 
Firstly, please ask the question in the body of the message. If you ask it
in the subject line, as you tried to do, it will probably be trunc.....

By "do no", do you mean include A1 unaltered?
By "delete everything to the left" do you mean that you want to output
everything to the right of the hyphen?

Try =IF(MID(A1,5,1)="-",MID(A1,6,9999),A1)
If you want to include the hyphen in the output, and just lose the preceding
4 characters, then try
=IF(MID(A13,5,1)="-",MID(A13,5,9999),A13)
--
David Biddulph

"Mike R." wrote in message
...
Hi -
I can't seem to figure this out, I bet it is pretty easy. Can anyone
assist?

The text is in A1.

Thanks,
Mike




Shane Devenshire[_2_]

If 5th character="-" delete everything to the left otherwise do no
 
Hi,

Try

=MID(A1,IF(MID(A1,5,1)="-",6,1),99)

Cheers,
Shane Devenshire

"Mike R." wrote:

Hi -
I can't seem to figure this out, I bet it is pretty easy. Can anyone assist?

The text is in A1.

Thanks,
Mike


Rick Rothstein

If 5th character="-" delete everything to the left otherwise do no
 
=MID(A1,IF(MID(A1,5,1)="-",6,1),99)

Stated another way...

=MID(A1,1+5*(MID(A1,5,1)="-"),99)

--
Rick (MVP - Excel)


All times are GMT +1. The time now is 06:45 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com