title: Excel - Assign value if specific text is found
body: <p>so i have a spreadsheet and i need to perform a rather basic function, but i can't get it to work using nested "IF", i just need to assign a value to a cell, if another specified cell contains specific criteria:</p>
  
  <p>-The function needs to count 0 if cell is empty</p>
  
  <p>-The functions needs to assign value of 1 to cell if defined cell contains the letter "L"</p>
  
  <p>-The function needs to assign value of 2 to cell if partial word "keyword" is found on cell</p>
  
  <p>i tried using </p>
  
  <pre><code>    '=IF(D5="",0,IF(D5="*L*",1,IF(D5="*keyword*",2)))'
  </code></pre>
  
  <p>so basically if:</p>
  
  <p>-D5 is empty, E5 should be "0"</p>
  
  <p>-D5 contains the letter "L", E5 should be "1"</p>
  
  <p>-D5 contains the word "keyword", E5 should be "2"</p>
  
  <p>using the above formula, it successfully applies "0" to the cell E5 when D5 is empty, in any other condition, it just shows "FALSE", any tips how i can accomplish this? in advance, thank you.</p>