= text() formula only working when I press enter

Viewed 58

I'm working in excel online. I already checked calculation issues. And for some reason the following formula only works when I go to the cell and hit enter:

=text(A1;"mmm-yy")

Expected output : Jan-21
Actual output: Jan-yy

If I go to the cell and hit enter I get the correct value, but if I open the file again sometimes is correct and sometimes not.

1 Answers

As mentioned in my comment; it doesn't look like your locale settings recognizes the "yy". I'd tackle that problem by using an actual numberformat on the cell itself which (should) keep working when sharing your file across different locales. It does also keep the numeric value of the cell's content intact.

If however you need to use this string somehow, you could use:

=REPLACE(TEXT(F12,"mmm-e"),5,2,)

Where "e" is the international placeholder1 for "yyyy". After that, we simply cut out the part of the resulting string we want to ignore.

1: I am yet to find actual documentation on this feature. It seems undocumented.

Related