Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date and Day Programming

In my spreadsheet, I have some inspection dates of some materials that I
have. I have to inspect these items on a "julian date" (30-day) interval.
For example:

A1 -- inspected date is 1 February 2006 (which is a Wednesday)
B1 -- Next inspection due date is 30 days from inspected date (may or may
not be
a Wedensday)

I have to inspect this item every 30 days, so I used the formula:

(In cell B1) "=A1+30"

This gave me 30 days after the inspected date, but I want the inspection to
show due on the Wednesday before the 30-day becomes due. Is there a way to
tell Excel to defer to the Wednesday immediately before the 30-day inpsection
is due?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Date and Day Programming

=A1+30-CHOOSE(WEEKDAY(A1),6,0,1,2,3,4,5)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gee-off" wrote in message
...
In my spreadsheet, I have some inspection dates of some materials that I
have. I have to inspect these items on a "julian date" (30-day) interval.
For example:

A1 -- inspected date is 1 February 2006 (which is a Wednesday)
B1 -- Next inspection due date is 30 days from inspected date (may or may
not be
a Wedensday)

I have to inspect this item every 30 days, so I used the formula:

(In cell B1) "=A1+30"

This gave me 30 days after the inspected date, but I want the inspection

to
show due on the Wednesday before the 30-day becomes due. Is there a way

to
tell Excel to defer to the Wednesday immediately before the 30-day

inpsection
is due?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date and Day Programming

Hey thanks Bob for your help. I used that formula in my cell, and it
returned a number of 25. What exactly is this displaying to me? I just
don't understand what exactly this formula is accomplishing. Thanks.

"Bob Phillips" wrote:

=A1+30-CHOOSE(WEEKDAY(A1),6,0,1,2,3,4,5)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gee-off" wrote in message
...
In my spreadsheet, I have some inspection dates of some materials that I
have. I have to inspect these items on a "julian date" (30-day) interval.
For example:

A1 -- inspected date is 1 February 2006 (which is a Wednesday)
B1 -- Next inspection due date is 30 days from inspected date (may or may
not be
a Wedensday)

I have to inspect this item every 30 days, so I used the formula:

(In cell B1) "=A1+30"

This gave me 30 days after the inspected date, but I want the inspection

to
show due on the Wednesday before the 30-day becomes due. Is there a way

to
tell Excel to defer to the Wednesday immediately before the 30-day

inpsection
is due?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,339
Default Date and Day Programming

Bob's formula subtracts a number based on the weekday of your planned
inspection date to calculate the date 28 days after to ensure it falls on a
Wednesday. I tried it and it works OK for me. B1 must be formatted as date.

"Gee-off" wrote:

Hey thanks Bob for your help. I used that formula in my cell, and it
returned a number of 25. What exactly is this displaying to me? I just
don't understand what exactly this formula is accomplishing. Thanks.

"Bob Phillips" wrote:

=A1+30-CHOOSE(WEEKDAY(A1),6,0,1,2,3,4,5)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gee-off" wrote in message
...
In my spreadsheet, I have some inspection dates of some materials that I
have. I have to inspect these items on a "julian date" (30-day) interval.
For example:

A1 -- inspected date is 1 February 2006 (which is a Wednesday)
B1 -- Next inspection due date is 30 days from inspected date (may or may
not be
a Wedensday)

I have to inspect this item every 30 days, so I used the formula:

(In cell B1) "=A1+30"

This gave me 30 days after the inspected date, but I want the inspection

to
show due on the Wednesday before the 30-day becomes due. Is there a way

to
tell Excel to defer to the Wednesday immediately before the 30-day

inpsection
is due?




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Date and Day Programming

thank you very much for the explanation.

"Toppers" wrote:

Bob's formula subtracts a number based on the weekday of your planned
inspection date to calculate the date 28 days after to ensure it falls on a
Wednesday. I tried it and it works OK for me. B1 must be formatted as date.

"Gee-off" wrote:

Hey thanks Bob for your help. I used that formula in my cell, and it
returned a number of 25. What exactly is this displaying to me? I just
don't understand what exactly this formula is accomplishing. Thanks.

"Bob Phillips" wrote:

=A1+30-CHOOSE(WEEKDAY(A1),6,0,1,2,3,4,5)

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Gee-off" wrote in message
...
In my spreadsheet, I have some inspection dates of some materials that I
have. I have to inspect these items on a "julian date" (30-day) interval.
For example:

A1 -- inspected date is 1 February 2006 (which is a Wednesday)
B1 -- Next inspection due date is 30 days from inspected date (may or may
not be
a Wedensday)

I have to inspect this item every 30 days, so I used the formula:

(In cell B1) "=A1+30"

This gave me 30 days after the inspected date, but I want the inspection
to
show due on the Wednesday before the 30-day becomes due. Is there a way
to
tell Excel to defer to the Wednesday immediately before the 30-day
inpsection
is due?



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 programming MeMe Excel Worksheet Functions 2 January 16th 06 06:50 PM
programming date functions Gail Excel Worksheet Functions 2 November 22nd 05 06:32 PM
Date & Time programming cj Excel Programming 1 September 9th 04 08:23 PM
Date programming - Absolutely confused. Malycom Excel Programming 3 June 17th 04 02:11 PM
Date Programming Dan E[_2_] Excel Programming 0 October 8th 03 05:59 PM


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