LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 31
Default How do I count the number of even weeks in the current month.


"dd" <dd.dd wrote in message ...
I receieve payments every two weeks.

I have a budget spreadsheet and I want to set up a function which tells me
the number of even-numbered weeks in the current month. I can then multiply
this figure, by the amount of each payment and include it in my budget
calculations.

Also, I want to know how to identify the start and end of month weeknumbers,
for each month. I can then use arguments to update the budget when the
payments are actually received?

Regards
DDawson
Scotland



DD, you want some step function, if I understand you, that gives the total for the current month, with payments every two weeks.

Assume in A1 some startdate for the very first payment when you started.
Say 1Jan2007 in A1. A monday.

A date of the current month in B1.

The current month total could be
=(100*(INT((B1-$A$1)/14)-INT((B1-DAY(B1)-$A$1)/14)))
This adds 100 every second monday stepping up from 0 in the current month.
Counting from the start date.

Involving the european weeknumber makes it more complicated,
especially since some years have 53 european weeks,
and I don't suppose you want sometimes to have a 3 week interval between payments.

Take the (ISO) weeknumber of 28dec to see how many european weeks a year has.
2009 has 53.

Microsoft doesn't provide a reliable european weeknumber,
so there is a small industry in ISO weeknumbers.
Here are two more using only simple functions:

On Excel Worksheet:

(1/1/1900-28/12/2104)
=INT(MOD(INT((d+2924)/7)*28,1461)/28+1)

(All dates)
=INT(MOD(MOD(MOD(INT((d+692501)/7),20871)*28+4383,146096),1461)/28+1)

As VBA function:
Function WkIso(d) '..1/1/100-31/12/9999 gregorian...
WkIso = ((((d + 692501) \ 7 Mod 20871) * 28 + 4383) Mod 146096 Mod 1461) \ 28 + 1
End Function

But for the step function you wanted they are not directly required.

Hope you can use that, Hans.


 
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
Number of weeks past in current qtr AD108 Excel Worksheet Functions 2 December 4th 06 01:17 PM
Show week number in current month DKerr Excel Discussion (Misc queries) 4 February 23rd 06 09:20 PM
Formula for current month minus one = Quarter number in a macro. Pank Excel Discussion (Misc queries) 11 June 22nd 05 02:47 PM
HELP - need to returns the current number of past month this year and ... elz64 Excel Worksheet Functions 6 April 6th 05 01:37 PM
how do i display the total number of days in the current month in. timerigger Excel Discussion (Misc queries) 6 March 20th 05 05:13 PM


All times are GMT +1. The time now is 07:21 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"