Extract / copy data from another sheet based on date range

TheJonWithNoH

New Member
Joined
Sep 8, 2017
Messages
30
I have a sheet (Sheet 2) with a start date in cell A1 and an end date in cell B1.

In another sheet (Sheet 1) I have a list of data, including dates in Column A and data in Columns B, C & D. Most of the dates in Column A are repetitive based on data value in Columns B, C & D.

I need to copy data from Sheet 1 to Sheet 2, including the repetitive dates, but only based on the date ranges on Sheet 2 in cells A1 & B1.

This new list of data on Sheet 2 should start in Column K through N and start in cell K3 through N3.

I have tried using the following formula in cell K1 which tells me how many instances are within the selected date range:

=COUNTIFS(DataDates,">="&StartSortDate,DataDates,"<="&EndSortDate)

I then use the following array formula starting in cell K3 & L3 which makes my workbook run VERY slow, but returns the correct dates & data in columns K & L, but columns M & N are numbers so this formula isn't working.

In K3 I have:{=IF(ROWS(K$3:K3)>K$1,"",TEXT(INDEX(Data1!A:A,SMALL(IF(Data1!A:A>=StartSortDate,IF(Data1!A:A<=EndSortDate,ROW(Data1!A:A))),ROWS(K$3:K3))),"m/d/yyyy"))}
In L3 I have:{=IF(ROWS(K$3:K3)>K$1,"",TEXT(INDEX(Data1!B:B,SMALL(IF(Data1!A:A>=StartSortDate,IF(Data1!A:A<=EndSortDate,ROW(Data1!A:A))),ROWS(K$3:K3))),""))}

How can I get the numbers from Sheet 1 over to Columns M & N? Also, is there a non-array formula that would be better? VBA code possibly?

Here's an example of my data on Sheet 1

10/1/2017RatePlan A1$150
10/1/2017RatePlan X5$500
10/2/2017RatePlan R3$350
10/2/2017RatePlan W1$100
10/3/2017RatePlan Q3$300

<tbody>
</tbody>

Thank you in advance for your help!!!!
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
just watched a video explaining something similar

i want to do the same but between workbooks so thinking a vb macro is more suited.
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,777
Members
449,049
Latest member
greyangel23

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