Pestomania

Active Member
Joined
May 30, 2018
Messages
292
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

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
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,214,826
Messages
6,121,793
Members
449,048
Latest member
greyangel23

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