A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

date criteria to select range



 
 
Thread Tools Display Modes
  #1  
Old August 16th, 2005, 02:51 AM
Kstalker
external usenet poster
 
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  
Old August 16th, 2005, 03:55 AM
Max
external usenet poster
 
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  
Old August 16th, 2005, 03:57 AM
Biff
external usenet poster
 
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



  #4  
Old August 16th, 2005, 04:05 AM
Biff
external usenet poster
 
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





  #5  
Old August 16th, 2005, 04:28 AM
Max
external usenet poster
 
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)-17,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
--



  #6  
Old August 16th, 2005, 04:29 AM
Kstalker
external usenet poster
 
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

  #7  
Old August 16th, 2005, 05:12 AM
Max
external usenet poster
 
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
--


  #8  
Old August 16th, 2005, 05:30 AM
Biff
external usenet poster
 
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



  #9  
Old August 16th, 2005, 05:40 AM
Kstalker
external usenet poster
 
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

  #10  
Old August 16th, 2005, 06:23 AM
Max
external usenet poster
 
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



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy Cat Ain't Working shep Setting Up & Running Reports 15 September 12th, 2005 05:14 PM
"Criteria Range" in the "Data/Filter/Advanced Filter" to select Du TC Worksheet Functions 1 May 12th, 2005 02:06 AM
Error Message - "Query is too complex" Steve Running & Setting Up Queries 6 May 6th, 2005 03:47 PM
Using Validation to force entry into cells? Mark General Discussion 16 October 27th, 2004 09:23 PM
Using date range in query criteria Kathi Running & Setting Up Queries 4 August 30th, 2004 03:10 PM


All times are GMT +1. The time now is 10:32 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.