Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


Basically I have 2 columns each with a list of dates in no particular
order (and containing blank cells too), one planned date column and one
actual date column.

What I need to do is plot this on a graph, and since the number of
dates has no set limit and I dont want to have to plot maybe 100 dates
on the x axis, so i want to group them by week before plotting them,
i.e. 10 dates for week ending 10th jan, 25 dates for week ending 17th
jan etc

I have a pivot table that counts how many of each date occurs, i.e. 10
x 2nd jan, 7x 3rd jan etc etc but it does not split them into weeks.

im sure theres an easyish way of doing it so i can get the 2 lines on
the graph for no. of planned dates each week and no. of actual dates
each week, i just cant see it.

thanks


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

=SUMPRODUCT(--(A2:A200=--"2006-01-04"),--(A2:A200<=--"2006-01-10"))

gives a count for the week in those dates

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"neowok" wrote in
message ...

Basically I have 2 columns each with a list of dates in no particular
order (and containing blank cells too), one planned date column and one
actual date column.

What I need to do is plot this on a graph, and since the number of
dates has no set limit and I dont want to have to plot maybe 100 dates
on the x axis, so i want to group them by week before plotting them,
i.e. 10 dates for week ending 10th jan, 25 dates for week ending 17th
jan etc

I have a pivot table that counts how many of each date occurs, i.e. 10
x 2nd jan, 7x 3rd jan etc etc but it does not split them into weeks.

im sure theres an easyish way of doing it so i can get the 2 lines on
the graph for no. of planned dates each week and no. of actual dates
each week, i just cant see it.

thanks


--
neowok
------------------------------------------------------------------------
neowok's Profile:

http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716



  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


hmmm that would work if i have a smallish, set number of weeks and i
know what the weeks are, but this is a dynamic document where the date
range is subject to change daily


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

Is the date a row field?

How about rightclicking on it and choosing choose Group and show detail.

Then group by weeks.

If excel's weeks are different than yours, you could use add a new column in the
raw data and determine the week based on whatever rules you follow. Then use
that in the pivottable.



neowok wrote:

Basically I have 2 columns each with a list of dates in no particular
order (and containing blank cells too), one planned date column and one
actual date column.

What I need to do is plot this on a graph, and since the number of
dates has no set limit and I dont want to have to plot maybe 100 dates
on the x axis, so i want to group them by week before plotting them,
i.e. 10 dates for week ending 10th jan, 25 dates for week ending 17th
jan etc

I have a pivot table that counts how many of each date occurs, i.e. 10
x 2nd jan, 7x 3rd jan etc etc but it does not split them into weeks.

im sure theres an easyish way of doing it so i can get the 2 lines on
the graph for no. of planned dates each week and no. of actual dates
each week, i just cant see it.

thanks

--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716


--

Dave Peterson
  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


the dates are in 2 columns, i went to group but cant see how i could
group them by week (no options for this)

top few cells of one of the planned date column and 2 extra needed for
the graph may look something like this if it all works

Planned week ending numberof items
01-01-06 01-01-06 3
<blank cell 08-01-06 2
<blank cell 15-01-06 1
05-01-06 26-02-06 1
01-01-06
01-01-06
25-02-06
<blank cell
<blank cell
15-01-06
03-01-06
<blank cell
etc etc

the graph could then be based on the week ending and number of items
column for the planned series, and then the same thing again for the
actual series.

I think i need to get an automated split of weeks in one column (B)
(ending on say sundays) and then in column C, the number of dates in
column A which falls during the week in column B

if not that then some other way of getting the same sort of result just
so I can draw the graph.


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

If your field has text or blanks, then you can't use that grouping.

Excel has a =weeknum() function that might be ok right out of the box.

=if(a2="","",weeknum(a2))
???


neowok wrote:

the dates are in 2 columns, i went to group but cant see how i could
group them by week (no options for this)

top few cells of one of the planned date column and 2 extra needed for
the graph may look something like this if it all works

Planned week ending numberof items
01-01-06 01-01-06 3
<blank cell 08-01-06 2
<blank cell 15-01-06 1
05-01-06 26-02-06 1
01-01-06
01-01-06
25-02-06
<blank cell
<blank cell
15-01-06
03-01-06
<blank cell
etc etc

the graph could then be based on the week ending and number of items
column for the planned series, and then the same thing again for the
actual series.

I think i need to get an automated split of weeks in one column (B)
(ending on say sundays) and then in column C, the number of dates in
column A which falls during the week in column B

if not that then some other way of getting the same sort of result just
so I can draw the graph.

--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


hm might be able to use severla more columns and use weeknum. i can use
a macro to copy the weeknum formula down for however many rows the
dates go, then maybe make a pivot table of that column giving me a
count of each weeknum, then somehow convert the weeknums into weeks
that i can use as x axis labels and base the chart off the pivottable
but without using a pivotchart. or something, but thats probly a bit
too complicated to work hehe ill have to fiddle with it on monday


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

Or instead of using the week number, use the date of the first day in the week
(or the Friday of that week or...)

neowok wrote:

hm might be able to use severla more columns and use weeknum. i can use
a macro to copy the weeknum formula down for however many rows the
dates go, then maybe make a pivot table of that column giving me a
count of each weeknum, then somehow convert the weeknums into weeks
that i can use as x axis labels and base the chart off the pivottable
but without using a pivotchart. or something, but thats probly a bit
too complicated to work hehe ill have to fiddle with it on monday

--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716


--

Dave Peterson
  #9   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


hmmm i think that would work better. how would i get the date of the
friday in that week? because i would need those dates anyway as the
axis labels.


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

  #10   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bob Phillips
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

=A1+(6-WEEKDAY(A1))

gets the Friday the date in A1

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"neowok" wrote in
message ...

hmmm i think that would work better. how would i get the date of the
friday in that week? because i would need those dates anyway as the
axis labels.


--
neowok
------------------------------------------------------------------------
neowok's Profile:

http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716





  #11   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


ok ive got 2 columns populated with planned dates and actual dates, all
converted to the friday of each week so i can get a count of how many
were planned/actual in a given week.

the major problem i have now is trying to plot the 2 series on the line
graph. to get the counts of each date ive had to use 2 pivot tables,
one that counts the dates in planned column and one counting the dates
in the actual column.

2 problems with this are, i cant plot a graph from 2 different pivot
tables, and even if i could, the ranges of weeks do not match, i.e. the
2 pivot tables show

planned count actual count
6 jan 06 6 18 nov 05 24
20 jan 06 2 25 nov 05 13
27 jan 06 2 2 dec 05 37
3 feb 06 1 9 dec 05 12
16 dec 05 12
23 dec 05 10
20 jan 06 2

so as you can see, i somehow need to group up the dates from both
planned and actual to use as the X axis catagories, and then plot the 2
series under the correct dates


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

  #12   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

And depending on what should happen to the Saturday following that Friday:
=A1+6-MOD(A1,7)



Bob Phillips wrote:

=A1+(6-WEEKDAY(A1))

gets the Friday the date in A1

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"neowok" wrote in
message ...

hmmm i think that would work better. how would i get the date of the
friday in that week? because i would need those dates anyway as the
axis labels.


--
neowok
------------------------------------------------------------------------
neowok's Profile:

http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716


--

Dave Peterson
  #13   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week

I'm not sure if this fits, but if you made the planned/actual category a column
field in the pivottable, would it work ok?

neowok wrote:

ok ive got 2 columns populated with planned dates and actual dates, all
converted to the friday of each week so i can get a count of how many
were planned/actual in a given week.

the major problem i have now is trying to plot the 2 series on the line
graph. to get the counts of each date ive had to use 2 pivot tables,
one that counts the dates in planned column and one counting the dates
in the actual column.

2 problems with this are, i cant plot a graph from 2 different pivot
tables, and even if i could, the ranges of weeks do not match, i.e. the
2 pivot tables show

planned count actual count
6 jan 06 6 18 nov 05 24
20 jan 06 2 25 nov 05 13
27 jan 06 2 2 dec 05 37
3 feb 06 1 9 dec 05 12
16 dec 05 12
23 dec 05 10
20 jan 06 2

so as you can see, i somehow need to group up the dates from both
planned and actual to use as the X axis catagories, and then plot the 2
series under the correct dates

--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716


--

Dave Peterson
  #14   Report Post  
Posted to microsoft.public.excel.worksheet.functions
neowok
 
Posts: n/a
Default need to convert list of dates to count no. of dates by week


thanks for replies.

i think i have a solution that works now using a few dummy columns with
various formulas in to reduce it down to the required data for the
graph.


--
neowok
------------------------------------------------------------------------
neowok's Profile: http://www.excelforum.com/member.php...fo&userid=5940
View this thread: http://www.excelforum.com/showthread...hreadid=505716

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
Count No. of times Dates are repeated Mandeep Dhami Excel Discussion (Misc queries) 6 December 8th 05 02:55 AM
count date occurances in range of dates... Alex Excel Worksheet Functions 2 July 27th 05 04:15 PM
user defined function Brian Rogge Excel Worksheet Functions 5 May 23rd 05 06:21 PM
have dates entered from a list of data into an excel template Diane Excel Discussion (Misc queries) 1 December 28th 04 06:33 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


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

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

About Us

"It's about Microsoft Excel"