Excel IF Formula with Text Format

Hello,
I created an Excel file and I would like some data to fill automatically based on what has been entered previously. For this, I thought of using the IF logical formula, but I can't apply it to cells containing text.
A formula like =IF(A1="congé","1")

To clarify, here is my file and my formula where the NAME is currently located:
http://www.cijoint.fr/cjlink.php?file=cj200808%2FcijEDVLnYh.xls

Thank you for your help.

3 answers

  1. =IF(A1="congé";1;0) 

    You need to put "" around the words and not around the numeric values. To use IF: you need to set the test: A1="Congé", then the value to put if the test is true: so 1, and also the value to put if the test is false: 0.
    31
    1. THANK YOUUUUUUUUUUUUUUUUUUUUU

      It's so awesome!
      And so responsive.

      I thank you a thousand times (and I will refrain from saying that I spent my day tearing my hair out over it! ...)
      0
    2. but you're welcome!
      --
      01/19/2038 03:14:07 UT
      0
    3. Thank you very much for your help

      perfect
      1
    4. Finally, 2 very good clarifications for the use of the "IF" function applied to texts.

      Many thanks to "the Dutchman" and "gbinforme"

      MM91
      1
    5. Hello everyone, (unable to go through "ask my question" so I'm going through here)

      I will try to explain my need clearly,

      I have a table where due dates appear, I want the column next to it to show either:

      **NOTHING** if the due date is more than 2 months away,

      or ALERT if the due date is in 1 month,

      or RENEW if the due date is in 20 days.

      Excel fascinates and frustrates me, I've been looking for days, I found a formula but it doesn't include all my conditions:

      =IF([@[Expected contract end date]]-20<today>

      If I do this I have to create several columns to meet all my conditions and that's not feasible at all.

      Thank you in advance to those who can help me

      </today></p>
      0