Help

Another Nest IF statement, what am I over looking

1892 6
cancel
Showing results for 
Search instead for 
Did you mean: 
Cathy_Anderson
6 - Interface Innovator
6 - Interface Innovator

IF(LEN(quote)>1, “QUOTE(s)\n” & quote,
IF(LEN(fact)>1, “FACT(s)\n” & fact,
IF(LEN(note)>1, “NOTE(s)\n” & note,
IF(LEN(question)>1, “QUESTION(s)\n” & question,
“”))))

6 Replies 6

Structurally, the nesting is sound. What problem are you having with it? It might be due to the type of data in the {quote}, {fact}, {note}, and/or {question} fields. Are those text fields? Links? Lookups? Rollups? ???

cathy_anderson2
5 - Automation Enthusiast
5 - Automation Enthusiast

quote fact note etc are Forumlas
TRIM(SUBSTITUTE(compileFacts,",","\n"))

compileFact, etc are Rollups
with ARRAYJOIN(values)

Thanks for the info, but you didn’t mention the problem you’re encountering. What is the behavior you expect from this formula vs what you’re actually getting?

cathy_anderson2
5 - Automation Enthusiast
5 - Automation Enthusiast

Of course…
I want to cycle through and pick up all the TRUE values.
It is stopping after the first one is valid.
So if Quote is True, Quote prints
But valid Facts, Notes etc do not.
make sense?

Yes, that makes a lot more sense. :slightly_smiling_face: Instead of nesting your IF functions inside each other, they need to be separate, and their individual results concatenated. Try this:

TRIM(
    IF(LEN(quote)>1, “QUOTE(s)\n” & quote & "\n\n") &
    IF(LEN(fact)>1, “FACT(s)\n” & fact & "\n\n") &
    IF(LEN(note)>1, “NOTE(s)\n” & note & "\n\n") &
    IF(LEN(question)>1, “QUESTION(s)\n” & question)
)

I added line breaks after each one so that there’s some space between them, and wrapped it all inside a TRIM function so that any trailing line breaks are removed; i.e. in case the question section isn’t the last part included.

cathy_anderson2
5 - Automation Enthusiast
5 - Automation Enthusiast

Justin you are awesome. Thank-you. That was exactly what I needed. Much appreciate your time.