If Function Date Format Changes to Serial Date

%3CLINGO-SUB%20id%3D%22lingo-sub-181858%22%20slang%3D%22en-US%22%3EIf%20Function%20Date%20Format%20Changes%20to%20Serial%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181858%22%20slang%3D%22en-US%22%3E%3CP%3E%3DIF((Genesis!AF2%3D%22%22)%2C%22%22%2CGenesis!AF2)%26amp%3BCHAR(10)%26amp%3BIF(Genesis!AG2%3D%22%22%2C%22%22%2CGenesis!AG2)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGenesis!AF2%20is%20a%20formulated%20Y%3C%2FP%3E%3CP%3EGenesis!AG2%20is%20a%20hard%20entry%20date%2C%201%2F1%2F18%2C%20and%20formatted%20to%20be%20as%20such%20date.%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20the%20formula%20to%20return%20as%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EY%3C%2FP%3E%3CP%3E1%2F1%2F18%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eif%20true%2C%20and%20if%20not%20then%20to%20leave%20blank.%20Genesis!AF2%20returns%20correctly%2C%20as%20Y%2C%20but%20Genesis!AG2%20returns%20a%20Serial%2C%20as%2043101.%20I%20have%20formatted%20the%20formula%20cell%20to%20match%20the%20same%20as%20the%20hard%20entry%20Date%20and%20still%20get%20Serial.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20entered%20the%20IF%20statement%20to%20return%20a%20blank%20if%20the%20date%20cell%20is%20blank%2C%20and%20if%20not%20then%20to%20return%20the%20cell.%20This%20works%2C%20but%20returns%20a%20Serial%20Date%20instead%20of%20the%20formatted%20date.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-181858%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20%26amp%3B%20Functions%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESERIALDATE%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-182278%22%20slang%3D%22en-US%22%3ERe%3A%20If%20Function%20Date%20Format%20Changes%20to%20Serial%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-182278%22%20slang%3D%22en-US%22%3E%3CP%3EYes%2C%20you%20shall%20check%20if%20the%20cell%20is%20blank%20or%20not.%20Like%20this%3C%2FP%3E%0A%3CPRE%3EIF(ISBLANK(AG2)%2C%22%22%2C(TEXT(AG2%2C%22mm%2Fdd%2Fyyyy%22))%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-182100%22%20slang%3D%22en-US%22%3ERe%3A%20If%20Function%20Date%20Format%20Changes%20to%20Serial%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-182100%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20there%20isn't%20a%20date%20entered%20in%20AG2%2C%20then%20your%20suggestion%20returns%20a%2001%2F00%2F1900%20instead%20of%26nbsp%3Bleaving%20the%20cell%20blank.%20Is%20there%20a%20way%20to%20keep%20my%20IF%20function%20and%20add%20the%20TEXT%20function%20as%20well%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-181941%22%20slang%3D%22en-US%22%3ERe%3A%20If%20Function%20Date%20Format%20Changes%20to%20Serial%20Date%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-181941%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20combine%20your%20value%20with%20text%20CHAR(10).%20Excel%20takes%20the%20value%20of%20the%20AG2%20cell%2C%20which%20is%2043101%2C%20convert%20to%20text%20and%20adds%20to%20the%20text%20before.%20To%20keep%20formatting%20use%20TEXT(AG2%2C%22mm%2Fdd%2Fyyyy%22)%20instead%20of%20cell%20AG2%20value.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
New Contributor

=IF((Genesis!AF2=""),"",Genesis!AF2)&CHAR(10)&IF(Genesis!AG2="","",Genesis!AG2)

 

Genesis!AF2 is a formulated Y

Genesis!AG2 is a hard entry date, 1/1/18, and formatted to be as such date. 

I want the formula to return as :

 

Y

1/1/18

 

if true, and if not then to leave blank. Genesis!AF2 returns correctly, as Y, but Genesis!AG2 returns a Serial, as 43101. I have formatted the formula cell to match the same as the hard entry Date and still get Serial.

 

I entered the IF statement to return a blank if the date cell is blank, and if not then to return the cell. This works, but returns a Serial Date instead of the formatted date. 

3 Replies
Highlighted

You combine your value with text CHAR(10). Excel takes the value of the AG2 cell, which is 43101, convert to text and adds to the text before. To keep formatting use TEXT(AG2,"mm/dd/yyyy") instead of cell AG2 value.

 

Highlighted

If there isn't a date entered in AG2, then your suggestion returns a 01/00/1900 instead of leaving the cell blank. Is there a way to keep my IF function and add the TEXT function as well?

Highlighted

Yes, you shall check if the cell is blank or not. Like this

IF(ISBLANK(AG2),"",(TEXT(AG2,"mm/dd/yyyy"))