Get Data bettween dates

swapnilk

Board Regular
Joined
Apr 25, 2016
Messages
75
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi,

So i have some data in the following format
ABCDEFGHI
1Emp ID1234
2Date_130-Nov-2016
3
4FromPayAllowanceTotal
501-Jul-2016500002000070000
601-Jul-2015400001000050000
7
8
9RESULT:
10APR-2016MAY-2016Jun-2016Jul-2016Aug-2016Sept-2016Oct-2016Nov-2016
114000040000400005000050000500005000050000
121000010000100002000020000200002000020000
135000050000500007000070000700007000070000

<tbody>
</tbody>

In above case, once you enter Emp ID in B1 data is displayed in B2 and A5:D6 using vlookup/array formulas. Now, i want to get the result i.e. A10:H13. A10:H13 displays the data of the last 8 months from the date in B2 based on the information in A5:D6. For e.g. Nov-2016 - 8 months is Apr-2016 so months from Apr-2016 to Nov-2016 are displayed in row 10 and subsequent data is displayed in the rows from 11 to 13.

Can someone help me with the formulas in A10:H13?

Thanks in advance!
 

Excel Facts

Copy PDF to Excel
Select data in PDF. Paste to Microsoft Word. Copy from Word and paste to Excel.
I had a try at this and I believe the following works.

Create A11 to H11 cells with month parameter going from -7 to 0
=EDATE($B$2,-7) this is A11
=EDATE($B$2,0) this is H11

In A12 enter
=INDEX($B$5:$B$6,(IF(ISNA(MATCH(A$11,$A$5:$A$6,-1)),0,MATCH(A$11,$A$5:$A$8,-1)))+1)

In a13 enter
=INDEX($C$5:$C$6,(IF(ISNA(MATCH(A$11,$A$5:$A$6,-1)),0,MATCH(A$11,$A$5:$A$8,-1)))+1)

In A14 enter
=INDEX($D$5:$D$6,(IF(ISNA(MATCH(A$11,$A$5:$A$6,-1)),0,MATCH(A$11,$A$5:$A$8,-1)))+1)

Copy A12-A14 to columns B to H
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,586
Messages
6,120,402
Members
448,958
Latest member
Hat4Life

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