0
votes

I have a Sheet with nested IFs, so that I can display different concatenated results depending on a value that I type in a certain cell.

Example:

A1 - I can type "Dog" "Cat" or "Rabbit"

Nested if says:

If "Dog" is in A1, then in cell A2, return G2&D2&F2

It's more complex, but that's the idea. So, formula essentially looks like this:

=IFS($A$1="Dog",G2&D2&F2,$A$1="Cat",C2&F2,R2,$A$1="Rabbit",H2,M2,N2)

Assume in the above that F2 contains dates in the format MM DD YY (i.e. 12/01/20).

  • If I call for F2 alone, it preserves the date format.

  • If I call F2 with other values (as above in the Dog and Cat examples), I get back a serial text string instead of the date-formatted value.

I want the date formatting of F2 to be preserved within Dog and Cat. How can I incorporate this into my IF statements and preserve the date formatting?

1

1 Answers

0
votes

Found a thread from which I was able to deduce the answer. Here is the correct solution:

Instead of merely retrieving &F2, I substituted the following:

&TEXT(F2,"DDD, m/dd")

DDD, m/dd was the format I chose for the particular results I was seeking.

This returns "Mon, 8/3" for example.

Thanks!