# expanding date range to pull corresponding data

1. ## 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. ## 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!

3. ## 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.

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