Extract of data based on specific criteria

Manexcel

Board Regular
Joined
Dec 28, 2015
Messages
128
Office Version
  1. 365
Platform
  1. Windows
I have a macro enabled workbook. The main worksheet, Year 2019, is made up of rows for the complete year.

01Jan19
to 31Jan19
.
.
01Dec19
to 31Dec19


Each day of month e.g. 01Jan19, may have one or more rows. The format of this date field is nnmmmnn

i wish extract all rows for a given month to another workbook eg jan or feb or dec. so if there are 31 rows for January I end up with 31 rows in the other workbook and only the selected columns from the year 2019 worksheet

and these rows to be updated automatically when the main worksheet, year 2019, is updated.


The main column headings are ;

start date - subject - who booked - start time - end time - description

These key columns are either text or date or time formatted.

can anyone assist in providing a formula to achieve this.

thank you for your consideration.
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
As requested below is sample data. Thank you for your time

Master sheet - Year 2019
[TABLE="width: 940"]
<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Date[/TD]
[TD]Day[/TD]
[TD]No in Mth[/TD]
[TD]MeetingFunction[/TD]
[TD]No.[/TD]
[TD]Func[/TD]
[TD]Mbrs.[/TD]
[TD]Fee[/TD]
[TD]Start Time[/TD]
[TD]End Time[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 1[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]1[/TD]
[TD]£1.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 2[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]2[/TD]
[TD]£2.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 3[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]3[/TD]
[TD]£3.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 4[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]4[/TD]
[TD]£4.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 5[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]5[/TD]
[TD]£5.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]01Jan19[/TD]
[TD]Tue[/TD]
[TD]1[/TD]
[TD]Name 6[/TD]
[TD]nnnn[/TD]
[TD]BH[/TD]
[TD]6[/TD]
[TD]£6.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]02Jan19[/TD]
[TD]Wed[/TD]
[TD]1[/TD]
[TD]Name 7[/TD]
[TD]nnnn[/TD]
[TD]TSaUCLSA[/TD]
[TD]7[/TD]
[TD]£7.00[/TD]
[TD]00:01[/TD]
[TD]23:59[/TD]
[/TR]
[TR]
[TD]02Jan19[/TD]
[TD]Wed[/TD]
[TD]1[/TD]
[TD]Name 8[/TD]
[TD]nnnn[/TD]
[TD]TSaUCLSA[/TD]
[TD]8[/TD]
[TD]£8.00[/TD]
[TD]00:01[/TD]
[TD]23:59
[/TD]
[/TR]
</tbody>[/TABLE]
to 31Dec19

Monthly sheet for Jan

[TABLE="width: 2141"]
<colgroup><col><col><col><col><col><col><col></colgroup><tbody>[TR]
[TD]Subject[/TD]
[TD]start Date[/TD]
[TD]Start Time[/TD]
[TD]End Date[/TD]
[TD]End Time[/TD]
[TD]All day event[/TD]
[TD]Description[/TD]
[/TR]
[TR]
[TD]Col D from 'master workbook' sheet Year 2019[/TD]
[TD]Col A 'master workbook' sheet Year 2019[/TD]
[TD]Col I from 'master workbook' sheet Year 2019[/TD]
[TD]Col A from 'master workbook' sheet Year 2019[/TD]
[TD]Col J from 'master workbook' sheet Year 2019[/TD]
[TD]not used[/TD]
[TD]Col S from 'master workbook' sheet Year 2019[/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Name 1[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 2[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 3[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 4[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 5[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 6[/TD]
[TD]01Jan19[/TD]
[TD]00:01[/TD]
[TD]01Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
[TR]
[TD]Name 7[/TD]
[TD]02Jan19[/TD]
[TD]00:01[/TD]
[TD]02Jan19[/TD]
[TD]23:59[/TD]
[TD][/TD]
[TD]Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
Hi Man,


This is working on my mock-up Workbooks, note that because we're working with a formula to index values from another workbook the Master workbook must be open for the formula to extract, otherwise you will get a Update Links prompt from excel. Use cell A2 (Jan Sheet) to enter in the start date for the month of each sheet you need to build.

Change the Sheet and Workbook names to suit your actual files and you'll need to increase this range to suit how many rows your Master sheet has or will be;

=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$D$2:$D$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))




Book1
ABCDEF
11st of MonthEnd Of Month
201-01-1931-01-19
3
4SubjectStart DateStart TimeEnd DateEnd TimeDescription
5Name 101-01-190:0101-01-1923:59Function: BH, Mem.: ,
6Name 201-01-190:0101-01-1923:59Function: BH, Mem.: ,
7Name 301-01-190:0101-01-1923:59Function: BH, Mem.: ,
8Name 401-01-190:0101-01-1923:59Function: BH, Mem.: ,
9Name 501-01-190:0101-01-1923:59Function: BH, Mem.: ,
10Name 601-01-190:0101-01-1923:59Function: BH, Mem.: ,
11Name 702-01-190:0102-01-1923:59Function: BH, Mem.: ,
12Name 802-01-190:0102-01-1923:59Function: BH, Mem.: ,
Sheet1
Cell Formulas
RangeFormula
B2=EOMONTH(A2,0)
B5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$A$2:$A$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
A5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$D$2:$D$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
C5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$I$2:$I$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
D5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$A$2:$A$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
E5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$J$2:$J$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
F5{=IF(ROWS($A$5:A5)>COUNTIFS('[Master 2019.xlsx]2019'!$A$2:$A$100,">="&$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$100,"<"&$B$2),"",INDEX('[Master 2019.xlsx]2019'!$S$2:$S$9,SMALL(IF(AND('[Master 2019.xlsx]2019'!$A$2:$A$9>=$A$2,'[Master 2019.xlsx]2019'!$A$2:$A$9<$B$2),ROW('[Master 2019.xlsx]2019'!$A$2:$A$9)-ROW('[Master 2019.xlsx]2019'!$A$2)+1),ROWS($A$5:A5))))}
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,224,822
Messages
6,181,164
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top