add period when needed

Manolocs

Active Member
Joined
Mar 28, 2008
Messages
340
Hello,
I am trying to fix period when needed, but take in consideration "," ":" "?" when inserting.
The formula I am trying to use is the below but it is adding another period at the end, and inserting a period when the cell is empty.
This formula was made by Special-k99 in another thread.
Thanks in advance

Code:
[COLOR=#333333]=trim(b1)&if(or(right(trim(b1),1)=":",right(trim(b1),1)="?"),"",".")[/COLOR]
 
Last edited:
The problem with cell A1 is that those three dots are not three individual dots, they are a single character called an ellipsis (which Excel automatically substitutes when it sees three adjacent dots). In the following formula, I simply added the ellipsis character to the list of terminating characters inside the FIND function)...

=TRIM(A1)&IF(ISNUMBER(FIND(RIGHT(TRIM(A1)),".,:?!…")),"",".")

You highlighted cell A5 in red... was that supposed to indicate my formula returned the wrong value? If so, what should it have returned?

Hello Rick Rothstein, the red in the A5 is wrongly set.
It is working but the idea is to eliminate the dots in excess and leave only one.
please if you change any one of the cell in the column A to end with a "," you will notice that does not add the period after.
Thanks for your time.
 
Upvote 0

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.

Forum statistics

Threads
1,216,073
Messages
6,128,641
Members
449,461
Latest member
kokoanutt

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