ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   IF function (https://www.excelbanter.com/excel-worksheet-functions/248504-if-function.html)

Imani

IF function
 
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.

Pete_UK

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

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

Hope this helps.

Pete

On Nov 15, 8:31*pm, Imani wrote:
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.



Gord Dibben

IF function
 
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

On Sun, 15 Nov 2009 13:09:53 -0800 (PST), Pete_UK
wrote:

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

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

Hope this helps.

Pete

On Nov 15, 8:31*pm, Imani wrote:
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.




All times are GMT +1. The time now is 07:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com