Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Kstalker
 
Posts: n/a
Default date criteria to select range


Hello

I have a conundrum which is proving very difficult.

I have a month set of data which has each day of the month as a header
and then a series of metrics under each day. What I need to do is sum 7
days worth of historic data from and including today.

in laymans

" if the column header = today then sum inc today the previous 7 days
from this row. "

As you can see i am at a loss. Have tried count, sumproduct etc but
cannot pull it together.

Any help as always greatly appreciated


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995

  #2   Report Post  
Max
 
Posts: n/a
Default

One play ..

Assuming in Sheet1, you have real dates in B1:AF1
from say: 1-Aug-2005 to 31-Aug-2005
with the numbers (your metrics) below in B2:AF2, B3:AF3 etc

In Sheet2 (say), we could put in A2:
=SUM(OFFSET(Sheet1!A2,,MATCH(TODAY(),Sheet1!$1:$1, 0)-1,,-7))
and copy A2 down to return the desired results from the corresponding rows
in Sheet1
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Kstalker" wrote in
message ...

Hello

I have a conundrum which is proving very difficult.

I have a month set of data which has each day of the month as a header
and then a series of metrics under each day. What I need to do is sum 7
days worth of historic data from and including today.

in laymans

" if the column header = today then sum inc today the previous 7 days
from this row. "

As you can see i am at a loss. Have tried count, sumproduct etc but
cannot pull it together.

Any help as always greatly appreciated


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:

http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995



  #3   Report Post  
Max
 
Posts: n/a
Default

And if there's the possibility that the number of historic data days in
Sheet1's B1:AF1 is < 7 days from "today", and you want for such situations
to just sum the available historicals up till and inclusive of "today"
(notwithstanding it's less than the specified 7 days), we could put instead
in Sheet2's A2:

=IF(MATCH(TODAY(),Sheet1!$1:$1,0)-1<7,SUM(OFFSET(Sheet1!A2,,MATCH(TODAY(),Sh
eet1!$1:$1,0)-1,,-(MATCH(TODAY(),Sheet1!$1:$1,0)-1))),SUM(OFFSET(Sheet1!A2,,
MATCH(TODAY(),Sheet1!$1:$1,0)-1,,-7)))

and copy down as before ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--



  #4   Report Post  
Kstalker
 
Posts: n/a
Default


Excellent.

Thanks for that Max.

Regards

Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995

  #5   Report Post  
Max
 
Posts: n/a
Default

You're welcome, Kristan !
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Kstalker" wrote in
message ...

Excellent.

Thanks for that Max.

Regards

Kristan





  #6   Report Post  
Biff
 
Posts: n/a
Default

Max, what do you see that I don't?

I would think this should be sufficient:

=IF(COUNT(2:2)<7,SUM(A2:AE2),.................

Biff

"Max" wrote in message
...
And if there's the possibility that the number of historic data days in
Sheet1's B1:AF1 is < 7 days from "today", and you want for such situations
to just sum the available historicals up till and inclusive of "today"
(notwithstanding it's less than the specified 7 days), we could put
instead
in Sheet2's A2:

=IF(MATCH(TODAY(),Sheet1!$1:$1,0)-1<7,SUM(OFFSET(Sheet1!A2,,MATCH(TODAY(),Sh
eet1!$1:$1,0)-1,,-(MATCH(TODAY(),Sheet1!$1:$1,0)-1))),SUM(OFFSET(Sheet1!A2,,
MATCH(TODAY(),Sheet1!$1:$1,0)-1,,-7)))

and copy down as before ..
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--





  #7   Report Post  
Max
 
Posts: n/a
Default

"Biff" wrote
Max, what do you see that I don't?
I would think this should be sufficient:
=IF(COUNT(2:2)<7,SUM(A2:AE2),.................


Trouble is <g, I had assumed that there could be previous month's metrics
still residing within the data rows (to the right of the current date's
col), either missed* out in the monthly purging exercise despite the refresh
of the current month's dates in the header row
*or yet to be purged because the data entry method followed is to
progressively overwrite.

--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #8   Report Post  
Kstalker
 
Posts: n/a
Default


Works well thanks Biff and Max.

I have one other question relating to this... I am trying to
incorporate a sumproduct function into the formula and cannot quite get
it to behave how I would like.

=IF(T25=0,0,IF(MATCH(TODAY(),$1:$1,0)-1<7,SUMPRODUCT((OFFSET(A3,,MATCH(TODAY(),$1:$1,
0)-1,,-7)),(OFFSET(A25,,MATCH(TODAY(),$1:$1,
0)-1,,-7)))/T25))-1,,-(MATCH(TODAY(),$1:$1,0)-1))),SUMPRODUCT((OFFSET(A3,,MATCH(TODAY(),$1:$1,
0)-1,,-7)),(OFFSET(A25,,MATCH(TODAY(),$1:$1, 0)-1,,-7)))/T25)


Again, if you get a minute could you take a look at the attached
formula and poitn out the error in my ways.

Thanks again.
Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995

  #9   Report Post  
Biff
 
Posts: n/a
Default

Hi!

So, what exactly do want to sum? (where is it?)

What if today is August 6? There aren't 7 days worth of data to sum!

One way.....

Assume row 1, A1:AE1, are the date headers in the format 8/1/2005

To sum the last 7 entries in row 2 from todays date (inclusive):

=IF(COUNT(2:2)<7,"Insufficient
Data",SUM(OFFSET(A2,,MATCH(TODAY(),A1:H1,0)-1,,-7)))

Biff

"Kstalker" wrote in
message ...

Hello

I have a conundrum which is proving very difficult.

I have a month set of data which has each day of the month as a header
and then a series of metrics under each day. What I need to do is sum 7
days worth of historic data from and including today.

in laymans

" if the column header = today then sum inc today the previous 7 days
from this row. "

As you can see i am at a loss. Have tried count, sumproduct etc but
cannot pull it together.

Any help as always greatly appreciated


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:
http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995



  #10   Report Post  
Biff
 
Posts: n/a
Default

Ooops!

One of the cell references is wrong. Should be:

=IF(COUNT(2:2)<7,"Insufficient
Data",SUM(OFFSET(A2,,MATCH(TODAY(),A1:AE1,0)-1,,-7)))

Biff

"Biff" wrote in message
...
Hi!

So, what exactly do want to sum? (where is it?)

What if today is August 6? There aren't 7 days worth of data to sum!

One way.....

Assume row 1, A1:AE1, are the date headers in the format 8/1/2005

To sum the last 7 entries in row 2 from todays date (inclusive):

=IF(COUNT(2:2)<7,"Insufficient
Data",SUM(OFFSET(A2,,MATCH(TODAY(),A1:H1,0)-1,,-7)))

Biff

"Kstalker" wrote
in message ...

Hello

I have a conundrum which is proving very difficult.

I have a month set of data which has each day of the month as a header
and then a series of metrics under each day. What I need to do is sum 7
days worth of historic data from and including today.

in laymans

" if the column header = today then sum inc today the previous 7 days
from this row. "

As you can see i am at a loss. Have tried count, sumproduct etc but
cannot pull it together.

Any help as always greatly appreciated


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:
http://www.excelforum.com/member.php...o&userid=24699
View this thread:
http://www.excelforum.com/showthread...hreadid=395995







  #11   Report Post  
Kstalker
 
Posts: n/a
Default


Cheers Max / Biff.

Biff as you pointed out there is the possibility of less than a weeks
worth of data if it is at the begining of the month.

If this occours i need to sum the week to dat figures even though there
are less than 7 entries.

If you have a minute, how can I acheive this?

Thanks

Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile: http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995

  #12   Report Post  
Max
 
Posts: n/a
Default

If this occours i need to sum the week to dat figures even though there
are less than 7 entries.


That's what I thought you might want <g.
One way .. see my follow up response in the other branch
(think you just missed it !)
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--


  #13   Report Post  
Biff
 
Posts: n/a
Default

Hi!

Try this:

=IF(COUNT(2:2)<7,SUM(A2:AE2),SUM(OFFSET(A2,,MATCH( TODAY(),A1:AE1,0)-1,,-7)))

Biff

"Kstalker" wrote in
message ...

Cheers Max / Biff.

Biff as you pointed out there is the possibility of less than a weeks
worth of data if it is at the begining of the month.

If this occours i need to sum the week to dat figures even though there
are less than 7 entries.

If you have a minute, how can I acheive this?

Thanks

Kristan


--
Kstalker
------------------------------------------------------------------------
Kstalker's Profile:
http://www.excelforum.com/member.php...o&userid=24699
View this thread: http://www.excelforum.com/showthread...hreadid=395995



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date range criteria and Pivot tables (again!) DerbyJim1978 Excel Worksheet Functions 3 July 13th 05 10:14 PM
Completion Percentage of a date range Brian Excel Discussion (Misc queries) 4 March 4th 05 05:49 PM
Formula to determine a future date based on criteria David Excel Worksheet Functions 2 December 15th 04 07:51 PM
I have a list of dates that I need to count based on a date range ejb030353 Excel Worksheet Functions 4 November 24th 04 02:27 PM
How can I sum information in a list with a date range? Dave Excel Worksheet Functions 2 November 23rd 04 08:17 PM


All times are GMT +1. The time now is 11:06 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"