+ Reply to Thread
Results 1 to 3 of 3

expanding date range to pull corresponding data

  1. #1
    Registered User
    Join Date
    03-28-2010
    Location
    ann arbor, mi
    MS-Off Ver
    Excel 2007
    Posts
    1

    Lightbulb expanding date range to pull corresponding data

    I'm doing an analysis of energy bills and need to account for daily weather differences (heating and cooling degree days). I have the start and end of each billing period, and need to use those to look up the degree days for each day within the billing period. I.e., if I give Excel a range of say, 6/18/08 - 7/18/08, can I have it scan a column with all of the individual dates in that range and pull the corresponding degree day values?

    THANKS SO MUCH!

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

    Re: expanding date range to pull corresponding data

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!
    Where there is a will there are many ways.

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

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

  3. #3
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,902

    Re: expanding date range to pull corresponding data

    I am hitting the sack..so I will attach a sample of my own... hopefully you can adapt it.

    I have the Start/End dates (input) in B1:B2

    I have the database in columns H:I

    I add a helper column in J to find matches...

    Formula in J2:

    =COUNTIF(H$2:H2,">="&$B$1)-COUNTIF(H$2:H2,">"&$B$2)

    copied down as far as the list

    in K2, I have the total count of matches: =MAX(J:J)

    Then in A5, formula to capture relevant data:

    =IF(ROWS($A$1:$A1)>$K$2,"",INDEX(H:H,MATCH(ROWS($A$1:$A1),$J:$J,0)))

    copied down as far as you want and over to next column.

    Change B1 and B2 to get new data.
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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.6.0 RC 1