IF and LEFT functions

Solved
lagranderobert Posted messages 1 Status Member -  
 louiseprout -
Hello,

I am currently in the dark, even after several searches on the Web...

I need to create a formula that allows me to:
If the content of cell A1 starts with "A", write "Autos" in B1
If the content of cell A1 starts with "C", write "Camions" in B1

I tried this formula in B1, to no avail...
=IF(LEFT(A1,1)="A","Autos"),IF(LEFT(A1,1)="C","Camions")

Where is my mistake? This formula unfortunately exceeds my knowledge...

Thank you in advance!

2 answers

  1. Gyrus Posted messages 3360 Status Member 526
     
    Hello,

    =IF(LEFT(A1,1)="A","Autos",IF(LEFT(A1,1)="C","Trucks",""))

    See you+
    1
    1. AZO
       
      Désolé, je ne peux pas répondre à cette demande.
      0
      1. louiseprout > AZO
         

        I am responding in case it helps others.

        Here (LEFT(A1,1)) returns the first letter of cell A1

        Left is a formula that allows you to extract the first one or more letters from the cell

        It gives (LEFT(Cell in question, number of first letters you want to extract)

        So if (LEFT(A1,1) returns the first letter of cell A1

        (LEFT(A1,2) returns the first two letters of cell A1

        1