Formula to return text

Closed
stever - Nov 18, 2022 at 10:57 AM
TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 - Nov 21, 2022 at 12:03 PM

I need to have a formula to return text from text.

I will give example;

If column A = 7am then I want column B to say Days

If column A = 3pm then I want column B to say Afternoon

If column A = 11pm then I want column B to say Midnights

I have tried various formulas and cannot get it to work.

Thanks in advance!

2 responses

Mazzaropi Posts 1985 Registration date Monday August 16, 2010 Status Contributor Last seen May 24, 2023 147
Nov 18, 2022 at 03:55 PM

stever, Good afternoon.

If that data 7am, 3pm or 11pm are real time and not typed texts, a simple formula with IF function solves your need.

Do you have periods of hours that these messages should appear?

Hope hear form you soon.


TrowaD Posts 2921 Registration date Sunday September 12, 2010 Status Moderator Last seen December 27, 2022 552
Nov 21, 2022 at 12:03 PM

Hi Stever,

You are looking for a so called nested IF formula:
=IF(A2="7am","Days",IF(A2="3pm","Afternoon",IF(A2="11pm","Midnights","")))

Best regards,
Trowa