roy.okinawa said:
Thanks. This is just what I was looking for.
It is working just fine.
However, although Columns J and T have unique dates,
m/dd/yyyy, I would like to enter mm/yyyy
in AF6 as the search criteria.
That's a new dimension to things, Roy <g>. It's much tougher now, since
there would probably be multiple returns for the month/year specified in AF6
(and I'm sure you want all of these).
Here's a play with non-array formulas which can drive out the results you
seek. I've provided 2 criteria options to illustrate depending on how
exactly you might wish to frame it up.
A sample implementation available at:
http://cjoint.com/?ckeMtEcoFC
Extract from 2 cols based on Mth_Yr Criteria.xls
In sheet: 1
Option1: Extract lines if date open & date closed are within the "mm/yyyy"
input in AF6
Data assumed within row 8 to row 20
Pre-format AF6 as Text
Inputs will be entered in AF6 as : mm/yyyy,
eg: 02/2006 (for Feb 2006)
In AF8:
=IF(ISERROR(SMALL($AG$8:$AG$20,ROW(A1))),"",
INDEX(TRIM($K$8:$K$20&"
"&$O$8:$O$20),MATCH(SMALL($AG$8:$AG$20,ROW(A1)),$AG$8:$AG$20,0)))
In AG8:
=IF(AND(TEXT(J8,"mm/yyyy")=$AF$6,TEXT(T8,"mm/yyyy")=$AF$6),ROW()/10^10,"")
Select AF8:AG8, copy down to AG20
(AG8:AG20 is the criteria col, with an arbitrary tiebreaker built-in)
-----------
In sheet: 2,
Option 2: Extract lines if date open is within the "mm/yyyy" input in AF6,
and if there is a date closed (i.e., item's closed), irrespective of date
closed falling outside the mth/yr indicated in AF6
Data assumed within row 8 to row 20
Pre-format AF6 as Text
Inputs will be entered in AF6 as : mm/yyyy,
eg: 02/2006 (for Feb 2006)
In AF8 (no change, same as in sheet: 1):
=IF(ISERROR(SMALL($AG$8:$AG$20,ROW(A1))),"",
INDEX(TRIM($K$8:$K$20&"
"&$O$8:$O$20),MATCH(SMALL($AG$8:$AG$20,ROW(A1)),$AG$8:$AG$20,0)))
In AG8 (changed):
=IF(AND(TEXT(J8,"mm/yyyy")=$AF$6,TRIM(T8)<>""),ROW()/10^10,"")
Select AF8:AG8, copy down to AG20
(AG8:AG20 is the criteria col, with an arbitrary tiebreaker built-in)