Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@if does not allow string result expressions #541

Closed
earthshrink opened this issue Apr 21, 2021 · 7 comments
Closed

@if does not allow string result expressions #541

earthshrink opened this issue Apr 21, 2021 · 7 comments

Comments

@earthshrink
Copy link

Entering @if with string result expressions, as in this example from the help file @if(A1>100,"over","not enough") leads to Illegal numeric expression error. The help file says Remember string expressions should be entered by typing \". But prefixing the quote with back-slash, as in entering @if(1=1,\"y",\"n") results in syntax error.
It does take @if(1=1, G1, G2), but it pulls the number and not the string in G1 or G2. I get 0, even though G1 contains the label true and no numeric value. Please advise if this works and what I am doing wrong.
thanks.

@andmarti1424
Copy link
Owner

You have to enter the whole formula with \"
and then:
@if(A1>100,"over","ne")

@earthshrink
Copy link
Author

Ah, in place of =. Thanks, this works!

@earthshrink
Copy link
Author

Unfortunately, when I quit the spreadsheet, it adds numeric value 0.00 to each such cell. So at next open, it shows over0.00 or ne0.00, etc.

@earthshrink
Copy link
Author

Workaround: :format " " (space required so it will be saved).

andmarti1424 added a commit that referenced this issue Apr 21, 2021
@andmarti1424
Copy link
Owner

Yep @earthshrink. That was an issue when saving the file rather than in the evaluation. Please update to latest commit on new branch and try again. Thanks.

@andmarti1424
Copy link
Owner

All stuff from new branch was merged to default freeze branch. So update to latest commit in there. Thanks.

@earthshrink
Copy link
Author

Updated to latest commit, it works- my workaround not needed.
thanks so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants