Excel IF Formula with Text Format

virg1980 -  
Raymond PENTIER Posted messages 58213 Registration date   Status Contributor Last intervention   -
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. le hollandais volant Posted messages 5294 Status Member 1 059
     
    =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. Coolfecamp
       
      Thank you very much for your help

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

      Many thanks to "the Dutchman" and "gbinforme"


      MM91
      1