ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Setting up an IF function using a name rather than a number (https://www.excelbanter.com/excel-discussion-misc-queries/115287-setting-up-if-function-using-name-rather-than-number.html)

karenhvb

Setting up an IF function using a name rather than a number
 
I want to set up formulas such as:
=IF(E7='Smith',F7,0)
=IF(E7='Jones',F7,0)
but it isn't working. Do I need a numerical value in the "logical test"?



Gord Dibben

Setting up an IF function using a name rather than a number
 
Change the single quotes to double quotes.

=IF(E7="Smith",F7,0)


Gord Dibben MS Excel MVP

On Thu, 19 Oct 2006 17:44:01 -0700, karenhvb
wrote:

I want to set up formulas such as:
=IF(E7='Smith',F7,0)
=IF(E7='Jones',F7,0)
but it isn't working. Do I need a numerical value in the "logical test"?



Gary''s Student

Setting up an IF function using a name rather than a number
 
Use double quotes not single quotes.
--
Gary's Student


"karenhvb" wrote:

I want to set up formulas such as:
=IF(E7='Smith',F7,0)
=IF(E7='Jones',F7,0)
but it isn't working. Do I need a numerical value in the "logical test"?



Teethless mama

Setting up an IF function using a name rather than a number
 
Try this:

=IF(OR(E7={"Smith","Jones"}),F7,0)


"karenhvb" wrote:

I want to set up formulas such as:
=IF(E7='Smith',F7,0)
=IF(E7='Jones',F7,0)
but it isn't working. Do I need a numerical value in the "logical test"?




All times are GMT +1. The time now is 06:14 AM.

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