How to use =Date() formula for a Date value that reads as number/text format

agohir

New Member
Joined
Aug 5, 2016
Messages
14
Hi, I have a long formula that determines dates based on certain criteria. Within the Formula I have a Date formula as follows: DATE(MID(P14,4,4),MID(P14,2,2),MID(P14,1,1)) But the value the formula reads appears as a text e.g. 42586. Can someone tell me how to read the text as a date so I can use =Date() formula to get the exact date. Right now if a date appears as 2016/08/04 in a cell, the above formula reads the date in a text 42586 and returns the date 1910/11/11.

I've tried searching online but I'm unable to find how to interpret the text 42586 as a date.

Thanks for the help/feedback.
 
Last edited:

Excel Facts

What is the shortcut key for Format Selection?
Ctrl+1 (the number one) will open the Format dialog for whatever is selected.
Hi agohir,

Excel internally handles dates as numbers, so 42586 is how it works with the date 04/08/2016. The corresponding number for 11/11/1910 is 3968. To change your number to the actual date you need to format your cell as a date. If that does not work due to your main formula returning an actual string, you can wrap your formula in a =VALUE() formula before doing the formatting.

I hope this helps.

Cheers,
Catalin
 
Upvote 0
Hi All,

I have a similar question. I want to subtract a date range (6-7 months) from a start date and would like it to appear in the cell as, "MM/DD/YYYY - MM/DD/YYYY". Right now the formula is returning 42491 - 42461:
=DATE(YEAR(F9),MONTH(F9)-6,DAY(F9))&" - "&DATE(YEAR(F9),MONTH(F9)-7,DAY(F9))

I tried the formula below, but no success:
=Text(DATE(YEAR(F9),MONTH(F9)-6,DAY(F9)),"mmm-dd")&" - "&Text(DATE(YEAR(F9),MONTH(F9)-7,DAY(F9)),"mmm-dd")

Thanks for any recommendations.
 
Upvote 0
Try this...
A​
B​
C​
26​
10/21/2016​
04/21/2017 to 05-21-2017
C26=TEXT(EDATE(A26,6),"mm/dd/yyyy")&" to "&TEXT(EDATE(A26,7),"mm-dd-yyyy")

edit: you may need to edit that to...
=TEXT(EDATE(A26,-6),"mm/dd/yyyy")&" to "&TEXT(EDATE(A26,-7),"mm-dd-yyyy")
 
Last edited:
Upvote 0

Forum statistics

Threads
1,216,180
Messages
6,129,340
Members
449,505
Latest member
Alan the procrastinator

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