Forum Discussion

Jeffern's avatar
Jeffern
Copper Contributor
Nov 28, 2023

Use of IF

=IF(B9=0;0;IF(B9='B3'='B2';IF(B9='B4'='B3)))

I get error messages

If a field='B3', I want to replace it with 'B2', if a field ='B4', I want to replace it with'B3*The fields are either blank(emty) =B3 or = B4.

Can you help me? 

28 Replies

  • JKPieterse's avatar
    JKPieterse
    Silver Contributor
    text in a formula needs to go between double quotes:
    =IF(A1="The text","Some text if true","Some text if false")
    • Jeffern's avatar
      Jeffern
      Copper Contributor

      JKPieterse 

      Thank you for informing me that double quots are necessary.

      I have other problems as well. Can you see what is wrong with the following?

      =IF(b9=blank;blank;IF(b9=''B3'';''B2''))

      Regards Jan Erik

      • Jeffern 

        You have to use the double quote character " (Shift+' on my keyboard), not two single quote characters ' next to each other.

        And blank is not a valid keyword in Excel. Use the empty string "" (two double quote characters) instead:

        =IF(B9="";"";IF(B9="B3";"B2"))

        What do you want to return if B9 is not empty and not equal to "B3"? In that case, the formula will currently return FALSE because you don't specify the return value.

Resources