Zebraboard
Zebraboard

Reputation: 210

Including a value that has a " in it in an IF statement

Is it possible to do the following in excel:

If the length of A1 is equal to 1, return error. Else, return [email protected]("VariableName")?

Like this:

=IF(LEN(D1)=1,"error","[email protected]("VariableName")")

The @ is a function made with a plugin in Excel and I need to use this function. Really, the only problem that I have is that the " is included in this function, around VariableName. Anyone that knows a workaround? The only one that I have found so far was to write [email protected]("VariableName") in another cell (for example K4) and refer to it, like this:

=IF(LEN(D1)=1,"error",K4)

But this is not a accepted workaround for my case, unfortunately.

Kind regards

Upvotes: 0

Views: 45

Answers (1)

Scott Craner
Scott Craner

Reputation: 152575

Formula nested inside other formula do not need the = and are not text strings, they just need to be nested:

=IF(LEN(D1)=1,"error",@asdf.Template("VariableName"))

Upvotes: 1

Related Questions