What function do I use to pull data prior to a certain date? [Closed]

Report
-
Posts
33
Registration date
Sunday June 19, 2016
Status
Contributor
Last seen
November 20, 2016
-
Hello,

I have a database that is organized quarterly. I would like to save myself from having to manually move data onto a new sheet after 3 months have passed. I tried using an IF function, but couldn't quite get it to work. What would others suggest?

(Current quarter in 1 sheet, ALL previous quarters on a seperate sheet, ideally to transfer automatically once the 3 months has ended.)

Thank you!


2 replies

Posts
1921
Registration date
Monday August 16, 2010
Status
Contributor
Last seen
May 13, 2021
143
NSamm, Good afternoon.

In your case, a simple formula or function won't work.

You need a VBA EXCEL programming to do your task.
Posts
33
Registration date
Sunday June 19, 2016
Status
Contributor
Last seen
November 20, 2016
1
This can be done with an index/small ARRAY function, but depending on the volume of data you are dealing with, it may slow your file down. Something like...

=iferror(index(A:A,small(if($A$1:$A$500<=your-selected-date,row($A$1:$A$500)),rows($A$1:A1))),"")

entered using CTRL SHIFT ENTER, not just enter, then copy down and across as needed

This is based on column A containing your dates - adjust as needed

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!