问题
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 !
回答1:
@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:
- Google for the function in english, using words Excel Function. Always use the link that starts with
https://support.office.com
- 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
)
- 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 arefr-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.
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.
来源:https://stackoverflow.com/questions/57803602/what-is-wrong-with-my-excel-formula-syntax