IF function in Google Sheets

Solved
GONJ Posted messages 14 Status Member -  
GONJ Posted messages 14 Status Member -
Hello,

I’m reaching out because I’m desperately unable to create the function I need :(

You will find my table attached; I want to add a function in column G based on the result in column H.
Indeed, if the result in column H is "canceled," then I would like column G to show 0€.

Additionally, as you can see, I’ve added conditional formatting based on the result in column H. However, this works for columns H and A, but not for the rest of the table. Does anyone know what this might be due to?

I hope I have been clear :)
Thanks in advance for your help!

1 answer

  1. Raymond PENTIER Posted messages 58226 Registration date   Status Contributor Last intervention   17 490
     
    Hello.

    No, it's not clear, because we only have a simple image!
    We need the Excel file itself.
     1) Go to https://www.cjoint.com/ 
    2) Click on [Browse] to select your file (max 15 MB)
    3) Scroll down to click on the blue button [Create Cjoint link]
    4) After a few seconds, the second page will appear, with the link in bold; right-click on it and choose "Copy link"
    5) Go back to your discussion on CCM, and in your message, paste it.
    =>See the guide https://www.commentcamarche.net/faq/29493-utiliser-cjoint-pour-heberger-des-fichiers

    --

    Retirement is great! Especially in the Antilles... :-)
    Raymond (INSA, AFPA, CF/R)
    0
    1. Raymond PENTIER Posted messages 58226 Registration date   Status Contributor Last intervention   17 490
       
      But it's something like =IF(H:H="CANCELLED",0,E:E*F:F)
      And for the conditional formatting, you misplaced your $, and incorrectly selected your ranges.
      0
    2. GONJ Posted messages 14 Status Member
       
      Hello,

      Thank you very much for your reply!!!
      Indeed, the IF function works wonderfully!
      As for the conditional formatting, I selected the entire range of my table, which is A2:H34. Regarding the function, here it is: =$H2:H34="cancelled".
      Do you see where the problem might be coming from?

      Best regards.
      0
    3. Raymond PENTIER Posted messages 58226 Registration date   Status Contributor Last intervention   17 490
       
      1) These are not two functions, but two formulas.
      2) I asked you for your file; I can hardly work without it...
      3) For the MFC, the formula would be rather =$H2="annulé".
      0
    4. GONJ Posted messages 14 Status Member
       
      Hello, indeed the formula works.
      Thank you very much for your help!
      0