I'm trying to display some text in a calculated column depending on whether or not the input of the other columns is blank.
The columns are single-line text: [Creator] and [Organisation].
The idea is to check if these columns have text in them and then display results accordingly:
- If [Organisation] is blank, just display the content of [Creator] (John Smith)
- If [Creator] is blank, just display the content of [Organisation] (StackExchange)
- If [Organisation] and [Creator] are blank, display the text "Unknown" (Unknown)
- If [Organisation] and [Creator] both have text, display [Creator] - [Organisation] (John Smith - StackExchange)
I've managed to work out a bit of code but can't seem to get it to work together properly.
For example:
- =IF(Organisation="",Creator,Creator&" - "&Organisation)
- =IF(Creator="",Organisation,Creator&" - "&Organisation)
- =IF(AND(Organisation="", Creator="", "Unknown", Creator&" - "&Organisation))
- =Creator&" - "&Organisation
When I try to put it together like this:
=IF(Organisation="",Creator,Creator&" - "&Organisation, IF(Creator="",Organisation, Creator&" - "&Organisation, IF(AND(Organisation="", Creator="", "Unknown", Creator&" - "&Organisation))))
I get a technical error.
Any help would be appreciated!
Edit: I realized I was missing a , before the IF(AND but it still didn't work.