ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   If function with and (https://www.excelbanter.com/excel-worksheet-functions/152055-if-function.html)

dereksmom

If function with and
 
What is the function if I both columns says "OPEN". If a cell in Column A is
"OPEN" and a cell in column B is "OPEN", then the result in a cell in Column
C should be 1. Otherwise, the result will be 0.

Example:

Column A Column B Column C
1 OPEN OPEN 1
2 OPEN Closed 0
3 open open 1
4 closed open 0

Thanks

Elkar

If function with and
 
Try this:

=IF(AND(A1="OPEN",B1="OPEN"),1,0)

HTH,
Elkar


"dereksmom" wrote:

What is the function if I both columns says "OPEN". If a cell in Column A is
"OPEN" and a cell in column B is "OPEN", then the result in a cell in Column
C should be 1. Otherwise, the result will be 0.

Example:

Column A Column B Column C
1 OPEN OPEN 1
2 OPEN Closed 0
3 open open 1
4 closed open 0

Thanks


driller

If function with and
 
dereksmom.

Column A Column B Column C
1 OPEN OPEN 1
2 OPEN Closed 0
3 open open 1
4 closed open 0


eg on C1:
=(A1="OPEN")*(B1="OPEN")

assuming that if "closed" appears on A1 or B1, Result is 0...




--
regards,
driller

*****
- dive with Jonathan Seagull



"dereksmom" wrote:

What is the function if I both columns says "OPEN". If a cell in Column A is
"OPEN" and a cell in column B is "OPEN", then the result in a cell in Column
C should be 1. Otherwise, the result will be 0.

Example:

Column A Column B Column C
1 OPEN OPEN 1
2 OPEN Closed 0
3 open open 1
4 closed open 0

Thanks


Harlan Grove

If function with and
 
dereksmom wrote...
. . . If a cell in Column A is
"OPEN" and a cell in column B is "OPEN", then the result in a cell
in Column C should be 1. Otherwise, the result will be 0.

....

One way

C2:
=--(COUNTIF(A2:B2,"OPEN")=2)

and another

C2:
=--AND(A2="OPEN",B2="OPEN")

Latter is shorter with 2 cells, but former becomes more compact with 3
or more cells.



All times are GMT +1. The time now is 08:18 PM.

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