Extract of data based on specific criteria

Manexcel

Board Regular
Joined
Dec 28, 2015
Messages
127
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

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
As requested below is sample data. Thank you for your time

Master sheet - Year 2019
DateDayNo in MthMeetingFunctionNo.FuncMbrs.FeeStart TimeEnd Time
01Jan19Tue1Name 1nnnnBH1£1.0000:0123:59
01Jan19Tue1Name 2nnnnBH2£2.0000:0123:59
01Jan19Tue1Name 3nnnnBH3£3.0000:0123:59
01Jan19Tue1Name 4nnnnBH4£4.0000:0123:59
01Jan19Tue1Name 5nnnnBH5£5.0000:0123:59
01Jan19Tue1Name 6nnnnBH6£6.0000:0123:59
02Jan19Wed1Name 7nnnnTSaUCLSA7£7.0000:0123:59
02Jan19Wed1Name 8nnnnTSaUCLSA8£8.0000:0123:59

<colgroup><col><col><col><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
to 31Dec19

Monthly sheet for Jan

Subjectstart DateStart TimeEnd DateEnd TimeAll day eventDescription
Col D from 'master workbook' sheet Year 2019Col A 'master workbook' sheet Year 2019Col I from 'master workbook' sheet Year 2019Col A from 'master workbook' sheet Year 2019Col J from 'master workbook' sheet Year 2019not usedCol S from 'master workbook' sheet Year 2019
Name 101Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 201Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 301Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 401Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 501Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 601Jan1900:0101Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )
Name 702Jan1900:0102Jan1923:59Function: BH, Mem.: , Hire Charge: £, Secretary: , Contact 1: , Contact 2: , Email: , Notations: IF APL: (Approx. Attend: , Meet Pur.: , Spec. Req.: , Notes: )

<colgroup><col><col><col><col><col><col><col></colgroup><tbody>
</tbody>
 
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,215,529
Messages
6,125,343
Members
449,219
Latest member
Smiqer

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