Excel format from mm/dd/yyyy to mm-dd-yyyy

4

I am trying to convert a date from a format with slashes to one with dashes. however when i try:

=SUBSTITUTE(B3,"/","-")

It converts my the would-be date into a date integer. I have tried formatting it and it doesn't work on the expression. Does anyone know a way to do this? Preferably one that does not involve having to use VBA?

Beninja2

Posted 2017-07-05T21:53:31.090

Reputation: 147

2Does B3 contain a real date value or text? If your formula results in a number, then you can format the result as a date. – teylyn – 2017-07-05T22:27:29.230

Answers

12

Simply

=B3

and format the cell with Custom format mm-dd-yyyy (write this format in the type box of the custom format dialog).

A.S.H

Posted 2017-07-05T21:53:31.090

Reputation: 430

1Thanks, I had a feeling I was missing something really obvious. – Beninja2 – 2017-07-06T13:34:09.423