Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Name The Week Of The Month

Good Afternoon All,



This is my second posting of this query. I did get some help, from Bob using

=INT(C3/7)+1 in Col A, (Thanks Bob), but it did not quite work for all
cases,

eg if $A$1 is 1st August 08, where the 1st is a Friday (week1), but the
following

Monday (the 4th) comes out as week 1 also, where it is supposed to be week
2.

Thanks to some help received here on my thread - Name The Date2 - I now need
to be able to name the Week in the month (ie 1-5) that the Day (Mon/Tues...)
falls in.
Example Spreadsheet below

A B C
1 = Today()
2 Week No Day Date (Header Row)
3 Tue 01
4 Wed 02
5 Thu 03
6 Fri 04



Etc Etc Etc


The Formula In Column B3 & copied down is
=TEXT(DATE(YEAR($A$1),MONTH($A$1),TRIM(C3)),"DDD")
which gives the Day of the date in Column C
Now in Column A, I would like a way to name the week of the month, ie 1 to
5. In this case the first Monday (the 7th) would be in Week2, but the
formulae I have tried, (including combinations of IF statements don't seem
to work, as only can nest 7), want to use the dates 01-07 as Week1, which is
obviously incorrect in this case.
I am trying to summarize all my company's direct debits, but have found it
difficult as the DAYS of the month fall on Different DATES of the month.
I hope I have explained this okay, and the formatting works when I post it!

As usual, any help is most appreciated.
Cheers
Mathew


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Name The Week Of The Month

On Wed, 16 Jul 2008 16:35:54 +0100, "Mathew"
wrote:

Good Afternoon All,



This is my second posting of this query. I did get some help, from Bob using


I am trying to summarize all my company's direct debits, but have found it
difficult as the DAYS of the month fall on Different DATES of the month.
I hope I have explained this okay, and the formatting works when I post it!

As usual, any help is most appreciated.
Cheers
Mathew


What, exactly, are you trying to do?

What rules do you want to use to determine what week of the month a particular
date is?
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 49
Default Name The Week Of The Month

Hi Ron, Thanks for your interest to help.
It is all about the 'working week', (Mon-Fri). Column C is simply the Date
of the month (1-31), Column B is a formula (see post) that works out the
actual Day (Mon/Tue...) depending on the date in $A$1 (actually today's
date, =Today()).
Now the crux of the matter, in Column A, I would like a formula/function
that works out into which week (working) hat each date falls into. eg 1st of
August 2008 falls on a Friday, so as it is a working day, is actually week 1
of August. Now, the following Mon-Fri should be week 2 etc, and the final
Mon-Fri (29th) shows week 5.
Then, because it is all driven by $A$1, he whole thing changes on the 1st of
each month.

Knock up the ss, and see how it should work, I think the example is a good
representation of my ss.

Cheers Ron, I do hope you can help. As I said earlier, I have tried various
work-arounds, but still flummoxed!

Mathew

"Ron Rosenfeld" wrote in message
...
On Wed, 16 Jul 2008 16:35:54 +0100, "Mathew"
wrote:

Good Afternoon All,



This is my second posting of this query. I did get some help, from Bob
using


I am trying to summarize all my company's direct debits, but have found it
difficult as the DAYS of the month fall on Different DATES of the month.
I hope I have explained this okay, and the formatting works when I post
it!

As usual, any help is most appreciated.
Cheers
Mathew


What, exactly, are you trying to do?

What rules do you want to use to determine what week of the month a
particular
date is?
--ron



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Name The Week Of The Month

On Wed, 16 Jul 2008 18:45:19 +0100, "Mathew P Bennett"
wrote:

Hi Ron, Thanks for your interest to help.
It is all about the 'working week', (Mon-Fri). Column C is simply the Date
of the month (1-31), Column B is a formula (see post) that works out the
actual Day (Mon/Tue...) depending on the date in $A$1 (actually today's
date, =Today()).
Now the crux of the matter, in Column A, I would like a formula/function
that works out into which week (working) hat each date falls into. eg 1st of
August 2008 falls on a Friday, so as it is a working day, is actually week 1
of August. Now, the following Mon-Fri should be week 2 etc, and the final
Mon-Fri (29th) shows week 5.
Then, because it is all driven by $A$1, he whole thing changes on the 1st of
each month.

Knock up the ss, and see how it should work, I think the example is a good
representation of my ss.

Cheers Ron, I do hope you can help. As I said earlier, I have tried various
work-arounds, but still flummoxed!

Mathew


Well, if your week always begins on Monday, then the following should return
what you are looking for.

A1: Base Date
A2: Week Number
B2: Day
B3: Date

A3: =IF(B3="","",SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT($A$1&":"&B3)))=2))+1)
B3:
=IF(MONTH($A$1)=MONTH($A$1-DAY($A$1)+ROWS($1:1)),$A$1-DAY($A$1)+ROWS($1:1),"")
custom format as ddd

C3 =B3
custom format as dd

Select A3:B3 and fill down 31 rows.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Name The Week Of The Month

On Wed, 16 Jul 2008 19:10:58 -0400, Ron Rosenfeld
wrote:

Well, if your week always begins on Monday, then the following should return
what you are looking for.

A1: Base Date
A2: Week Number
B2: Day
B3: Date

A3: =IF(B3="","",SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT($A$1&":"&B3)))=2))+1)
B3:
=IF(MONTH($A$1)=MONTH($A$1-DAY($A$1)+ROWS($1:1)),$A$1-DAY($A$1)+ROWS($1:1),"")
custom format as ddd

C3 =B3
custom format as dd

Select A3:B3 and fill down 31 rows.
--ron


Oops.

The above will occasionally give incorrect results.

I wrote "week always begins on Monday".

That being the case, the formula for A3 should be:

=IF(B3="","",SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT($A$1-DAY($A$1)+1&":"&B3)))=2))
+OR(WEEKDAY($A$1-DAY($A$1))={2,3,4,5}))

The only potential problem with this formula is that if the month begins on a
Saturday, then the first Saturday and Sunday will belong to week zero (0).

Would you rather have that, or have the week start on Saturday?
--ron


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Name The Week Of The Month

On Wed, 16 Jul 2008 19:10:58 -0400, Ron Rosenfeld
wrote:

Well, if your week always begins on Monday, then the following should return
what you are looking for.

A1: Base Date
A2: Week Number
B2: Day
B3: Date

A3: =IF(B3="","",SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT($A$1&":"&B3)))=2))+1)
B3:
=IF(MONTH($A$1)=MONTH($A$1-DAY($A$1)+ROWS($1:1)),$A$1-DAY($A$1)+ROWS($1:1),"")
custom format as ddd

C3 =B3
custom format as dd

Select A3:B3 and fill down 31 rows.
--ron



OK, this formula in A3 will have the week starting on Saturday, if that's what
you prefer:

=IF(B3="","",SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT($A$1-DAY($A$1)+1&":"&B3)))=7))
+(WEEKDAY($A$1-DAY($A$1))<6))

--ron
  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10
Default Name The Week Of The Month

Giood morning Ron, Thank you very much, your solution is great, I would not
have been able to fathom out your formula. I have gone for the week
beginning Saturday.
Thanks again.
Mathew
"Mathew" wrote in message
...
Good Afternoon All,



This is my second posting of this query. I did get some help, from Bob
using

=INT(C3/7)+1 in Col A, (Thanks Bob), but it did not quite work for all
cases,

eg if $A$1 is 1st August 08, where the 1st is a Friday (week1), but the
following

Monday (the 4th) comes out as week 1 also, where it is supposed to be week
2.

Thanks to some help received here on my thread - Name The Date2 - I now
need
to be able to name the Week in the month (ie 1-5) that the Day
(Mon/Tues...)
falls in.
Example Spreadsheet below

A B C
1 = Today()
2 Week No Day Date (Header
Row)
3 Tue 01
4 Wed 02
5 Thu 03
6 Fri 04



Etc Etc Etc


The Formula In Column B3 & copied down is
=TEXT(DATE(YEAR($A$1),MONTH($A$1),TRIM(C3)),"DDD")
which gives the Day of the date in Column C
Now in Column A, I would like a way to name the week of the month, ie 1 to
5. In this case the first Monday (the 7th) would be in Week2, but the
formulae I have tried, (including combinations of IF statements don't seem
to work, as only can nest 7), want to use the dates 01-07 as Week1, which
is
obviously incorrect in this case.
I am trying to summarize all my company's direct debits, but have found it
difficult as the DAYS of the month fall on Different DATES of the month.
I hope I have explained this okay, and the formatting works when I post
it!

As usual, any help is most appreciated.
Cheers
Mathew




  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Name The Week Of The Month

On Thu, 17 Jul 2008 08:05:35 +0100, "Mathew"
wrote:

Giood morning Ron, Thank you very much, your solution is great, I would not
have been able to fathom out your formula. I have gone for the week
beginning Saturday.
Thanks again.
Mathew


Glad to help. Thanks for the feedback.

Let me know (preferably in this thread) if any problems arise, or if you have
any questions.
--ron
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
Week of the Month Janet BN Excel Discussion (Misc queries) 9 October 17th 07 12:01 AM
Count Week Of Month Emilio S. Excel Worksheet Functions 4 October 4th 07 04:24 AM
Whats the Week of the Month? ceemo Excel Discussion (Misc queries) 6 August 1st 06 08:43 PM
how to get week number in month in excel ? ikin Charts and Charting in Excel 2 January 16th 05 05:54 PM
calculate month from week number ankman Excel Worksheet Functions 2 November 24th 04 01:27 AM


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

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"