Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
526 views
in Technique[技术] by (71.8m points)

if statement - What is wrong with my excel formula syntax?

I have made several formula to dynamically create a SQL query but to make it perfect, I want to add a condition : "if cell is not blank".

I've tried a lot of different syntaxe but even with a very simple one (see exemple below), I get an error.

My formula is :

="""" & SUBSTITUE(E2;"'";"''") & """"

It works well and give me "Accordéoniste d''hier"

I've tried

=IF(E2<>"";"""" & SUBSTITUE(E2;"'";"''") & """";"")

Excel display #NOM? in the cell but doesn't give me an explicit error.

I've tried a very simple one, but I get the same result : #NOM?

=IF(1=1;"Delivered";"")

I've tried ISBLANK but same result... I think there is something wrong and I don't see it...

Thanks for your help !

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

@rory is totally right. It looks like your Excel is in French, so you need to use SI instead of IF.

Excel works with local formulas, so you need to know the name of the functions in whatever language Excel has been set up.

Stack Overflow always post answer in english, and sometimes users like me need the translation of a function to their native languages. There's a trick to get the name of a function in a specific language I've used hundreds of times and it works pretty good with Stack Overflow.

Let's see your case. You see the solution is using the function IF and you need to know how is called that function in your language.

Of course there are several sources in Internet where you can check, but I like to use this one:

  1. Google for the function in english, using words Excel Function. Always use the link that starts with https://support.office.com

enter image description here

  1. Using that link will take you to the official documentation about that function, in english, but check the URL, the part of the language (in image it says en-us)

enter image description here

  1. Change en-us for the initials of the language you want to see, and navigate to that new url. I don't know all of them but some of them are fr-fr for french, es-es for spanish, pt-br for portuguese (brazilian), pt-pt for portuguese, de-de for german, and so on.

In your case, you want in in french so replace en-us with fr-fr and you will see the name of the function in french. Same works for ISBLANK and other functions.

enter image description here

There you go. Now you know the name of the function in french, and you can apply it to your needs. This trick works for all functions documented in Excel. Hope it can help other users.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...