Removing generic date value within formula

Damian37

Active Member
Joined
Jun 9, 2014
Messages
301
Office Version
  1. 365
Hello all,
I've written a formula that removes the time stamp and time zone for a date value. Wherever the date field is blank a generic date is placed there '01/00/1900'. I would like to replace the generic dates with a blank instead. The formula I'm using is:

HTML:
=TEXT(IF(CELL("type",F230)="l",LEFT(F230,FIND(" ", F230)),INT(F230)),"mm/dd/yyyy")

I thank you for any help anyone can give me.
D.
 

Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.
maybe check here: CELL function

"type"

Text value corresponding to the type of data in the cell. Returns "b" for blank if the cell is empty, "l" for label if the cell contains a text constant, and "v" for value if the cell contains anything else.
 
Upvote 0
post your date/dates

The generic date structure that is coming up for blank cells is '01/00/1900'. I cannot seem to get these cells to stay blank so when I use them in a calculation formula that I have, I don't receive #VALUE instead of just a blank cell.
D.
 
Upvote 0
try =IF(ISBLANK(P13),"",TEXT(IF(CELL("type",P13)=CHAR(108),LEFT(P13,FIND(" ", P13)),INT(P13)),"mm/dd/yyyy"))
adjust reference
 
Upvote 0
post your date/dates

I'm not sure I understand your request. The dates are regular short dates, that have been converted from dates with a timestamp and time zone within them. The formula removes the timestamp and time zone, however for blank cells, it creates a generic date '01/00/1900' instead of returning a blank value. I would just like to have the cell appear blank instead of having a generic date placed there.
 
Upvote 0
You are welcome
Have a nice day

btw.
with PowerQuery this is simple:

Raw dataParse
2019-05-23T20:09:37.8739799+02:00
23/05/2019​
Code:
[SIZE=1]// Table1
let
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    Type = Table.TransformColumnTypes(Source,{{"Raw data", type text}}),
    Parse = Table.AddColumn(Type, "Parse", [COLOR="#0000FF"]each Date.From(DateTimeZone.From([Raw data])), type date[/COLOR]),
    ROC = Table.SelectColumns(Parse,{"Parse"})
in
    ROC[/SIZE]
 
Last edited:
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,253
Members
448,556
Latest member
peterhess2002

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