1

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:

  1. If [Organisation] is blank, just display the content of [Creator] (John Smith)
  2. If [Creator] is blank, just display the content of [Organisation] (StackExchange)
  3. If [Organisation] and [Creator] are blank, display the text "Unknown" (Unknown)
  4. 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:

  1. =IF(Organisation="",Creator,Creator&" - "&Organisation)
  2. =IF(Creator="",Organisation,Creator&" - "&Organisation)
  3. =IF(AND(Organisation="", Creator="", "Unknown", Creator&" - "&Organisation))
  4. =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.

1 Answer 1

0

Use below formula:

=IF(ISBLANK([Organisation]), IF(ISBLANK([Creator]), "Unknown", [Creator]), IF(ISBLANK([Creator]), [Organisation], [Creator]&" - "&[Organisation]))

Official documentation:

  1. Calculated Field Formulas
5
  • 1
    Thank you so much - it worked!
    – Bramble
    Jun 21 at 6:45
  • Great, glad it worked for you. Please accept as an Answer as it helped you & it will help others with similar question in future to find the correct answer easily. Jun 21 at 6:49
  • 1
    Done :) Thanks again!
    – Bramble
    Jun 21 at 6:57
  • You're welcome. Keep using this platform to ask your questions related to SharePoint. Jun 21 at 6:58
  • 1
    I will. I have a different question related to IFs but I'll make a new topic for it since it's to do with Microsoft Forms and Sharepoint calendars.
    – Bramble
    Jun 21 at 7:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.