If statement not working

Anonymous
2017-10-31T10:14:24+00:00

hi

I entered the following formula and it wont return text.  I get the error #NAME? Im pretty experienced in excel and the formula works ok when i use it on my IMac. It does work if i point to other cells rather than trying to return text. 

=if(x=y,”yes”,”no”)

thanks

Norrie

Microsoft 365 and Office | Excel | For home | iOS

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Anonymous
    2017-10-31T11:20:28+00:00

    This formula will work only if the workbook has a cell named x and another named y.

    Try this:

    In A1 enter the text x , in B1 the value 4

    In A2 enter the text y , in B2 the value 6

    Select A1:B2; on the Formulas tab, use Create from Selection (see snip)

    Now IF(x=y, "yes", "no") will work

    best wishes

    0 comments No comments
  2. Anonymous
    2017-10-31T12:26:27+00:00

    Thanks bernard. I had thought of that but was curious why such a basic formula in excel wasnt working.  Im using excel for ipad and there doesnt seem to be any way of adding names so cant do that either. 

    cheers

    norrie

    0 comments No comments
  3. Anonymous
    2017-10-31T13:07:58+00:00

    Hi Norrie,

    We do not support naming cells in Excel iPad. However you should be able to compare direct cell reference or names that are already present in the excel sheet (if created from mac). So if you already have a cell named "x" then your formula should work. if not then you can try the formula as IF(A1=B1,"Yes","No"). This should work. 

    Let me know if you are still facing issues. 

    Thanks, 

    Sanjay Bhat

    0 comments No comments
  4. Anonymous
    2017-10-31T13:58:59+00:00

    Sanjay

    thanks for your response. I can work around the problem by pointing at cells with text in them. I was just curious as to why i cant return text in an if statment using quotes. Pretty basic requirement. Thought i had lost the plot as they say in scotland. 😉

    E.g. if( x=y,”yes”,”no”).  Wont let me return yes or no without referencing other cells with the words in them. 

    Thanks

    norrie

    0 comments No comments
  5. Anonymous
    2017-10-31T14:19:37+00:00

    Hi Norrie, 

    I think i understood what is going on, you are currently using smart quotes:

    if( x=y,yes,no)

    You need to use the block double quote character "

    so your formula should say

    if( x=y,"yes","no")

    You can enter this from your keyboard by pressing the quote character and choosing the block quote character. 

    Let me know if this works. 

    Thanks, 

    Sanjay

    0 comments No comments