Excel formatting in a mixed cell

Copper Contributor

Hello,

I'm trying to set up a cell to display "on mm/dd/yy", where the date is pulled from another cell via an index and match function. 

The cell formula is  ="on "&INDEX(...)). However, instead of showing "on 7/22/20", the result returns the numeric equivalent of the date - for example, "on 44034".  I can't figure out how to get it to display the date format within this mixed cell content.  Can anyone help?

Sincerely,

JQuinn

7 Replies

@JQuinn 

 

Assuming your date is in cell A1, use this ="on "&TEXT(A1,"m/d/y")

 

Because what you're doing is creating a text entry, you need to turn the date into a text and format it. The TEXT function takes care of that, and one of the arguments is the way you want it displayed. The same sort of thing would apply if you were dealing, say, with financial numbers and wanted it to be in dollars and cents.

@mathetes 

 

Thank you.  That works.  

I just need to figure out how to merge it with the Index-Match formula, so I don;t need to point to an alternate cell for the date.
Thanks, again,
JQuinn

@JQuinn 

 

So long as your spreadsheet doesn't contain private or confidential info, you can post it here so we can work with the actual situation rather than having to reconstruct it from your description.

 

I think that "all you'd need to do" is nest the INDEX/MATCH function within that TEXT function, assuming that what the INDEX/MATCH is doing is getting the date in question. It's hard to be certain without seeing more directly what you're working with.

@JQuinn 

Alternatively you may apply to the cell into which INDEX/MATCH returns the date custom format like

image.png

Plus is that it still will be a date, not text, with which you may work - compare with our dates, whatever.

Thank you, Sergei.

That would be an elegant solution.  However, I can't seem to apply that format to the cell and get the intended response. It still displays as 'on 44034'.  (See capture image.)

Do you know if that formatting is restricted to certain versions of Excel? I'm using Excel 2016.

JQuinn

 

 

@Sergei Baklan 

Thank you for the offer.  However, there's a ton of confidential info in that file, some of which is integral to the that cell.  For now, I'll just generate the Index/Match date elsewhere and refer to it in the mixed content cell, using your suggested approach.

Gratefully,

JQuinn

 

@mathetes 

@JQuinn 

In general it shall work. If I apply custom format to such number

image.png

result is

image.png

If you apply simple date format to the value returned by formula, is it converted to date form? Hard to say what's wrong without sample file.