dasdsdsaadsdsadasdasadas
New Member
- Joined
- Jan 16, 2014
- Messages
- 2
I want to do this with only formula, not any scripts.
I want to be able to Remove everything BEFORE the LAST occurrence of the a period (and keep the cell blank if there isn't a period present).
Ex: This table shows what I need it to do.My current formula handles rows 2-4. However, I need help with row 5.[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B[/TD]
[TD]Note[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]helloworld.pdf[/TD]
[TD]pdf[/TD]
[TD]removed everything before last period[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]hi.hop.doc[/TD]
[TD]doc[/TD]
[TD]notice this has two periods. it needs to remove everything BEFORE the last period[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]happytimes\document.txt[/TD]
[TD]txt[/TD]
[TD]removed everything before last period[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]document1[/TD]
[TD][/TD]
[TD]Since a period is not present. I need it to be blank.[/TD]
[/TR]
</tbody>[/TABLE]
The formula below works great at removing everything after last occurrence of the period. However, it returns the cell value if a period isn't present in column A (as shown below).
=TRIM(LEFT(RIGHT(SUBSTITUTE(A2,".",REPT(" ",LEN(A2))),LEN(A2)),LEN(A2)))
Ex:
[TABLE="width: 500"]
<tbody>[TR]
[TD]5[/TD]
[TD]document1[/TD]
[TD]document1[/TD]
[TD]Since a period is not present. I need it to be blank. The formula is currently returning the value in column A when a period isn't present.
[/TD]
[/TR]
</tbody>[/TABLE]
I want to be able to Remove everything BEFORE the LAST occurrence of the a period (and keep the cell blank if there isn't a period present).
Ex: This table shows what I need it to do.My current formula handles rows 2-4. However, I need help with row 5.[TABLE="width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A
[/TD]
[TD]B[/TD]
[TD]Note[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]helloworld.pdf[/TD]
[TD]pdf[/TD]
[TD]removed everything before last period[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]hi.hop.doc[/TD]
[TD]doc[/TD]
[TD]notice this has two periods. it needs to remove everything BEFORE the last period[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]happytimes\document.txt[/TD]
[TD]txt[/TD]
[TD]removed everything before last period[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]document1[/TD]
[TD][/TD]
[TD]Since a period is not present. I need it to be blank.[/TD]
[/TR]
</tbody>[/TABLE]
The formula below works great at removing everything after last occurrence of the period. However, it returns the cell value if a period isn't present in column A (as shown below).
=TRIM(LEFT(RIGHT(SUBSTITUTE(A2,".",REPT(" ",LEN(A2))),LEN(A2)),LEN(A2)))
Ex:
[TABLE="width: 500"]
<tbody>[TR]
[TD]5[/TD]
[TD]document1[/TD]
[TD]document1[/TD]
[TD]Since a period is not present. I need it to be blank. The formula is currently returning the value in column A when a period isn't present.
[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: