1

I'm trying to add a formula to a specific cell in my French Excel, but I get an error when I try to run it. Any ideas on what to change?

Just to add, I got this English formula by using the "Inserting an action" button and it automatically translated my formula in French. The selected sheet is already defined without errors.

// Set range C11 on selectedSheet
    selectedSheet.getRange("C11").setFormulaLocal("=IFERROR(SORT(FILTER('Sheet number two'!A1:I496,ISNUMBER(SEARCH(R4C4,'Sheet number two'!A1:A496))*ISNUMBER(SEARCH(R5C4,'Sheet number two'!B1:B496))*(IF(F4,'Sheet number two'!C1:C496=\"Modèle1\",FALSE)+IF(G4,'Sheet number two'!C1:C496=\"Modèle2\",FALSE))*ISNUMBER(SEARCH(R6C4,'Sheet number two'!E1:E496))),6,-1),\"Aucun résultat\")");

1 Answer 1

0

setFormulaLocal sets the formula for the object, using A1-style references in the language of the user. It seems French function names should be used.

To verify yourself, just enter the formula into a cell then print getFormulaLocal. All details will get clear for you.

Or just use setFormula instead of setFormulaLocal.

It the formula, you mixed A1 and RC reference styles: ISNUMBER(SEARCH(R6C4,. Use the A1 style only.

=IFERROR(
  SORT(
    FILTER('Sheet number two'!A1:I496,
      ISNUMBER(SEARCH(D4,'Sheet number two'!A1:A496))
        *ISNUMBER(SEARCH(D5,'Sheet number two'!B1:B496))
        *(IF(F4,'Sheet number two'!C1:C496=\"Modèle1\",FALSE)
          +IF(G4,'Sheet number two'!C1:C496=\"Modèle2\",FALSE))
        *ISNUMBER(SEARCH(D6,'Sheet number two'!E1:E496))
    ),
  6,-1),
\"Aucun résultat\")
Sign up to request clarification or add additional context in comments.

3 Comments

If I put the French formula in setFormulaLocal instead of the English formula, I get even more errors, such as "Can't find name" and "',' expected"
Does not work either, in French or English, with setFormula
Oh! Seems to be working now, with the code you sent. Thank you so much for your help, really appreciate it

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.