+ Reply to Thread
Results 1 to 3 of 3

Thread: return data which occurred in a period

  1. #1
    Registered User
    Join Date
    12-02-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    83

    return data which occurred in a period

    Hi There.

    I'm trying to find a way to return data which occurred in the past period.

    For example, i have the following data set up as follows.

    A B C
    1 1/2/02 Purchase of pants -$15,000
    2 12/2/02 Sale of shoes $4,000
    3 31/3/02 Sale of xxx $2,400
    4 13/5/02 Purchase of ties -$2,000

    etc etc

    I'm looking for a lookup function of some sort which can look at the above data and a return all the transactions that occurred in the month of February for example. I don't want to use an autofilter as I'm drawing the data from various spreadsheets.....

    I hope someone can help.

    Cheers

    Easty
    Last edited by NBVC; 08-08-2010 at 01:34 PM.

  2. #2
    Forum Guru NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    32,636

    Re: return data which occurred in a period

    Say you have that data in Sheet1 and you enter an input date of Feb-1, 2002 to represent month of February in B1 of Sheet2, then, in Sheet1 add a column in D2, with formula:

    =IF(MONTH(A2)=MONTH(Sheet2!$B$1),COUNT(D$1:D1)+1,"")

    copied down to assign numerical sequence to matching months

    then in E2 enter: =MAX(D:D) to get number of matching records.

    In Sheet2, A2 enter:

    =IF(ROWS($B$1:$B1)>Sheet1!$E$2,"",INDEX(Sheet1!A:A,MATCH(ROWS($B$1:$B1),Sheet1!$D:$D)))

    copied down as far as you need and across 2 more columns.
    Attached Files Attached Files
    Microsoft MVP - Excel

    Where there is a will there are many ways. Pick One!


    Please read the Forum Rules

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

    Preferred Charities: Lupus Canada and Sick Kids Foundation.
    Feel Free to Donate if you want to, for the assistance you received today.

  3. #3
    Registered User
    Join Date
    12-02-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    83

    Re: return data which occurred in a period

    WOW!!!!

    That works perfectly. I didn't think that could be done......I'll be able to use this for a lot of things.

    thanks heaps!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.2.0