Forum Discussion
Jeffern
Nov 28, 2023Copper Contributor
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) =...
Jeffern
Nov 29, 2023Copper Contributor
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
HansVogelaar
Nov 29, 2023MVP
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.
- JeffernNov 30, 2023Copper ContributorThank you again for the information. I think I get the gist of it now. I will even try to expand the problem to include B4 changed to B3, then there will be three IF's. I hope I can do it with four parenthesis at he end.
- JeffernNov 30, 2023Copper ContributorSorry to bother you again. When enter exactly what you suggest, I get an error message: The formula contains unknown text. I do not understand it. Any suggestions?
- HansVogelaarNov 30, 2023MVP
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar?
- JeffernNov 29, 2023Copper ContributorThank you for your help. I do not know the syntax in excel well. At the end I would enter a double quote. Actually, there is an addition to this problem: If b9=“” B4»»; “B3””,””. This problem is a playlist in tennis which i recurring twice a year.
- HansVogelaarNov 29, 2023MVP
This time. you're using "curly quotes" ”” instead of straight quotes "".
And you definitely shouldn't use »» in Excel.
Also, you forgot the parentheses and a semicolon.
=IF(B9="";"";IF(B9="B3";"B2";""))
Alternatively, slightly shorter:
=IF(B9="B3";"B2";"")