0

I need the following array for a Date type:

=IF(OR(A2:C2="Mar 12"),1,0)

Sample Data https://docs.google.com/spreadsheet/ccc?key=0AhoDU0OTM87sdHR3RGw3NTJacEV1OEt5OWZTWTBYUFE&usp=sharing

Looking at the sample data, in Column E I want an array formula that would look into columns B to D and search for results that contain 'May 12' and display true or false (1 or 0) in column E.

2 Answers 2

3

I think this will meet your needs - type in D2:

=IF(SUM((MONTH(A2:C2)=5)*(YEAR(A2:C2)=2013))>0,1,0)

but press CTRL+SHIFT+ENTER instead of usual ENTER - this will define an ARRAY formula and will result in {} brackets around it (but do NOT type them manually!).

Specify month and year as you wish)

Sign up to request clarification or add additional context in comments.

1 Comment

Glad to help buddy) Hope you learned the lesson of proper task formulation)
0

I think this is what you're looking for (noticed the date format was dd/mm/yyyy so I adjusted):

=IF(COUNTIF(A1:C1,"12/5/2013")>0,TRUE,FALSE)

Edit:

For just month and day:

=IF(SUMPRODUCT((MONTH(A1:C1)=5)*(DAY(A1:C1)=12))>0,TRUE,FALSE)

Month and year:

=IF(SUMPRODUCT((MONTH(A1:C1)=5)*(YEAR(A1:C1)=2012))>0,TRUE,FALSE)

1 Comment

How do I do it without specifying a 'Day' though? Just month and year?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.