One approach using non-array formulas which should deliver it for you ..
Illustrated in this "plug-n-play" sample construct:
http://www.savefile.com/files/994757
Maintenance Contract Tracking Sys.xls
Assume source data as posted in row2 down
in sheets: X (your sheet1) and Y (your sheet2)
[I like to use v.short sheetnames, makes formulas v.shorter]
In a sheet: Z (this is your sheet3),
In A10:
=IF(Y!U2="","",IF(Y!U2<=DATE(YEAR(TODAY()),MONTH(TODAY())+2,0),ROWS($1:1),""))
In B10
=IF(ROWS($1:1)>COUNT($A$10:$A$300),"",INDEX(Y!A:A,SMALL($A$10:$A$300,ROWS($1:1))+1))
In C10
=IF(ROWS($1:1)>COUNT($A$10:$A$300),"",INDEX(Y!O:O,SMALL($A$10:$A$300,ROWS($1:1))+1))
In D10
=IF(ROWS($1:1)>COUNT($A$10:$A$300),"",INDEX(Y!S:S,SMALL($A$10:$A$300,ROWS($1:1))+1))
In E10
=IF(ROWS($1:1)>COUNT($A$10:$A$300),"",INDEX(Y!U:U,SMALL($A$10:$A$300,ROWS($1:1))+1))
In F10
=IF(ROWS($1:1)>COUNT($A$10:$A$300),"",INDEX(Y!V:V,SMALL($A$10:$A$300,ROWS($1:1))+1))
In G10:
=IF(B10="","",INDEX(X!$U:$U,MATCH(B10,X!$A:$A,0)))
Select A10:G10, copy down to G300. Cols B to G will auto-return the required
results from sheets X and Y, with all lines neatly bunched at the top.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Phill_Morgan" wrote:
> Hi All,
>
> I am trying to build a maintenance cntract tracking system. This workbook
> contains all my infrastructure assets, maintenance start/end dates, contact
> details, contract numbers, costs and other miscellaneous data. One of the
> results I need to produce is a list of all maintenance contracts that will
> expire by 30th of the next calendar month. Eg. If we are in August, I want to
> return anything that will expire before 30th September in the current year.
>
> I have the asset name in column A of sheet1 and sheet2. I need to extract
> only the rows based on the date in column U in sheet2 and merge colums A and
> U from sheet 1 with columns O, S, U and V from sheet2 and place the results
> in Sheet3.
>
> Sheet3 has headings and other content, so the placement needs to start at
> row 10. As the result list length could be variable, and my total length of
> the table in sheets 1 & 2 is 280 rows I woulkd want to ensure that rows after
> the end of the extract in sheet3 are blanked out.
>
> Is this possible in Excel 2003 natively? or will it require scripting? If
> so, could you please suggest appropriate code.
>
> Many thanks,
> Phillip Morgan
>
>
>