ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Using Function IF (https://www.excelbanter.com/excel-discussion-misc-queries/3260-using-function-if.html)

cihow81

Using Function IF
 
Cell A1 is a variable
Cell A2 is a variable
Cell A6=IF(ABS(A1-A2)<2,TRUE,FALSE)

Instead of Displaying True and False when data are inserted into the cells,
could i display other words, such as YES and NO? If can, how do i do it?



Nick Hodge

Certainly

=IF(ABS(A1-A2)<2,"Yes","No")

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"cihow81" wrote in message
...
Cell A1 is a variable
Cell A2 is a variable
Cell A6=IF(ABS(A1-A2)<2,TRUE,FALSE)

Instead of Displaying True and False when data are inserted into the
cells,
could i display other words, such as YES and NO? If can, how do i do it?





Jack Sheet

One way:
Change formula in A6 to
=IF(ABS(A1-A2)<2,TRUE,FALSE)*1
and custom number the cell to be:
"YES";;"NO"

Another way:
Change formula in A6 to
=IF(ABS(A1-A2)<2,"YES,"NO")

The first method is probably preferred if there are other cells with
formulae that refer to cell A6 and expect it to contain a boolean value.


"cihow81" wrote in message
...
Cell A1 is a variable
Cell A2 is a variable
Cell A6=IF(ABS(A1-A2)<2,TRUE,FALSE)

Instead of Displaying True and False when data are inserted into the

cells,
could i display other words, such as YES and NO? If can, how do i do it?





Gabriele

Dear chihow,

yes you can. The formula would look liie this: A6=IF(ABS(A1-A2)<2,"yes","no")

"cihow81" wrote:

Cell A1 is a variable
Cell A2 is a variable
Cell A6=IF(ABS(A1-A2)<2,TRUE,FALSE)

Instead of Displaying True and False when data are inserted into the cells,
could i display other words, such as YES and NO? If can, how do i do it?




All times are GMT +1. The time now is 04:36 AM.

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