ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   IF...AND statement in cell (https://www.excelbanter.com/new-users-excel/266066-if-statement-cell.html)

NISMOJim

IF...AND statement in cell
 
I am working in Excel 2003, and am new to programming in Excel.
Column A is an imported date (mm/dd/yyyy), Column B is the same date (=A1 formatted as mmm) so that any year will work the same, and column C is text. In column D I want a statement something like this:
=IF(B1="Apr" AND C1="Joe",1,0).
Of course, this isn't working, even though it looks to me like it should. What am I missing? Any help with how to get this working as expected would be greatly appreciated.

wickedchew

Quote:

Originally Posted by NISMOJim (Post 959702)
I am working in Excel 2003, and am new to programming in Excel.
Column A is an imported date (mm/dd/yyyy), Column B is the same date (=A1 formatted as mmm) so that any year will work the same, and column C is text. In column D I want a statement something like this:
=IF(B1="Apr" AND C1="Joe",1,0).
Of course, this isn't working, even though it looks to me like it should. What am I missing? Any help with how to get this working as expected would be greatly appreciated.

=IF(AND(B1="Apr",C1="Joe"),1,0)

Mazzaropi

Quote:

Originally Posted by NISMOJim (Post 959702)
I am working in Excel 2003, and am new to programming in Excel.
Column A is an imported date (mm/dd/yyyy), Column B is the same date (=A1 formatted as mmm) so that any year will work the same, and column C is text. In column D I want a statement something like this:
=IF(B1="Apr" AND C1="Joe",1,0).
Of course, this isn't working, even though it looks to me like it should. What am I missing? Any help with how to get this working as expected would be greatly appreciated.

--------------------------------------------------------------------------

Dear NISMOjim, Good Morning

You donīt need to use another colunm to control monthīs date.

Try this one: IF(AND(MONTH(A1)=4,C1="JOE"),1,0)

Use the monthīs number.(1=Jan;2=Feb;3=Mar...)

NISMOJim

Quote:

Originally Posted by Mazzaropi (Post 959707)
--------------------------------------------------------------------------

Dear NISMOjim, Good Morning

You donīt need to use another colunm to control monthīs date.

Try this one: IF(AND(MONTH(A1)=4,C1="JOE"),1,0)

Use the monthīs number.(1=Jan;2=Feb;3=Mar...)


Works perfect. Thanks so much for the help, and I'm sure I will be back with more questions.


All times are GMT +1. The time now is 10:36 PM.

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