Format Cells

Pestomania

Active Member
Joined
May 30, 2018
Messages
330
Office Version
  1. 365
Platform
  1. Windows
Hello.

I have cells that contain dates in the following formats:

"9/13-"
"9/13-9/14"
"-9/14"

What I am trying to determine is if I can force the "hyphen" into the cell. So if I type:

"9/13"

The format will auto-update to:

"9/13-"

I formulas that are based on that "-" being there.

How can I do this if someone forgets to place the hyphen?
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Given the formats you showed us, how do you know the missing dash belongs at the end instead of at the beginning? Since you would need event code to do what you asked, wouldn't it be better to have that code stop the user and pop up a MessageBox advising them that their entry is missing the required dash? Would that approach be acceptable?
 
Last edited:
Upvote 0
Hi Rick.

Thank you for replying so quick.

I was just playing around with the formats for a few minutes and when I changed it just text, everything worked fine. With or without a dash.

My other formulas would read (without dash) the date as a value, rather than as "9/13". I changed it to text and it accepted the "9/13" as that and returned the same.

Thank you!
 
Upvote 0

Forum statistics

Threads
1,223,228
Messages
6,170,875
Members
452,363
Latest member
merico17

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