IF function

I

Imani

If I create a function which checks for text in a cell, it gives a #NAME?
error.
I have a sheet with a cell containing the text 'Single'. In another cell I
want to check for that word so I type =if(a1=''Single'', 1,2). Is there
something wrong with that IF, it happens with any text I check for.
 
P

Pete_UK

Perhaps you need to use a semicolon rather than a comma - try it this
way:

=IF(A1="Single";1;2)

Hope this helps.

Pete
 
G

Gord Dibben

Imani

I copied your formula from your post onto Excel.

Looks like you have, instead of double quotes, two single
quotes(apostrophes) before and after the string Single

Re-type using double quotes.

If Single is realy 'Single' then

=IF(A!="'Single'",1,2)



Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top