# Is there an IFS type function for text? (if A1 is blank, use B1, etc.) [closed]

Is there a function for using the first non-blank text expression the result? I attempted to use the SWITCH function, but it seems restricted to a single expression (e.g.: A1). Below is my attempt before testing with text expressions. It works for numeric ones.

=IFS(AND(N6="",O6<>""),O6,AND(O6="",P6<>""),P6,AND(P6="",Q6<>""),Q6,AND(Q6="",R6<>""),R6,AND(R6="",N6=""),"",N6,N6)

edit retag reopen merge delete

### Closed for the following reason the question is answered, right answer was accepted by yarow12 close date 2020-09-09 04:06:19.852934

Sort by » oldest newest most voted

yes, it is, (imho)

=IFS(A3<>"";A3; A4<>"";A4; A5<>"";A5)


add more cases as you like ...

"nested if's" would work as well, but often confuse coders once there are too many parentheses ...

P.S. 'solved marks' and 'likes' welcome,
click the grey circled hook - ✓ - top left to the answer to turn it green if the problem is solved,
click the "^" above it if you 'like' the answer,
"v" if you don't,
'answer' only if you found a solution yourself ...

more

This worked, thanks. I just had to end the loop by adding something to the end (see below).

=IFS(N6<>"",N6, O6<>"",O6, P6<>"",P6, P6="", "")

( 2020-09-09 04:03:40 +0200 )edit

Hello,

this should work

=IFERROR(IFS(NOT(ISBLANK(A1)),A1,NOT(ISBLANK(B1)),B1),"all empty")


Hope that helps.

To show the community your question has been answered, click the ✓ next to the correct answer, and "upvote" by clicking on the ^ arrow of any helpful answers. These are the mechanisms for communicating the quality of the Q&A on this site. Thanks!

Have a nice day and let's (continue to) "Be excellent to each other!"

more

1

I couldn't get this to work for me. Took out the "..." and then the 2nd to last line, but I kept getting an Err:50x result.

( 2020-09-09 04:06:03 +0200 )edit
1

I guess the Linebreaks were your problem, i guess i should have places the example in one line, ... i'll fix it But newbie-02 example is a little shorter with the <> operator, so i guess that makes it a bit more appealing.

( 2020-09-09 09:15:03 +0200 )edit