Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 470
Default Formula help needed

I have a worksheet that I enter paycheck data on. The date of each check is
automatically computed. Checks is on the 15th and 30th of each month. After
setting the first pay date as 1/15/09, the remainder of the dates are
computed using the following formula (which works fine):


=IF(DAY(A42)=15,MIN(DATE(YEAR(A42),MONTH(A42),30), DATE(YEAR(A42),MONTH(A42)+1,0)),DATE(YEAR(A42),MON TH(A42)+1,15))

....where A42 = 1/15/09.

The problem I have is if the 15th or 30th falls on a weekend, then the
actual date needs to be backed up to Friday's date. Can someone show me how
to accomplish that?

Thanks,
Les
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 5
Default Formula help needed

On 20 Sty, 14:36, WLMPilot wrote:
I have a worksheet that I enter paycheck data on. *The date of each check is
automatically computed. *Checks is on the 15th and 30th of each month. *After
setting the first pay date as 1/15/09, the remainder of the dates are
computed using the following formula (which works fine):

=IF(DAY(A42)=15,MIN(DATE(YEAR(A42),MONTH(A42),30), DATE(YEAR(A42),MONTH(A42)*+1,0)),DATE(YEAR(A42),MO NTH(A42)+1,15))

...where A42 = 1/15/09.

The problem I have is if the 15th or 30th falls on a weekend, then the
actual date needs to be backed up to Friday's date. *Can someone show me how
to accomplish that?

Thanks,
Les


There is a function weekday(date) in excel. It returns the weekday as
an integer from 1 to 7. Try to check if weekdate(yourdate) = 6 and <=
7 and you should detect a weekend.

Regards
lolo
  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,420
Default Formula help needed

=IF(DAY(A42)=15,WORKDAY(MIN(DATE(YEAR(A42),MONTH(A 42),30),DATE(YEAR(A42),MONTH(A42)+1,0))+1,-1),DATE(YEAR(A42),MONTH(A42)+1,15))

this uses the WORKDAY function from the Analysis Toolpak (ATP). If you get
an error, make sure it is installed (ToolsAddins)

--
__________________________________
HTH

Bob

"WLMPilot" wrote in message
...
I have a worksheet that I enter paycheck data on. The date of each check
is
automatically computed. Checks is on the 15th and 30th of each month.
After
setting the first pay date as 1/15/09, the remainder of the dates are
computed using the following formula (which works fine):


=IF(DAY(A42)=15,MIN(DATE(YEAR(A42),MONTH(A42),30), DATE(YEAR(A42),MONTH(A42)+1,0)),DATE(YEAR(A42),MON TH(A42)+1,15))

...where A42 = 1/15/09.

The problem I have is if the 15th or 30th falls on a weekend, then the
actual date needs to be backed up to Friday's date. Can someone show me
how
to accomplish that?

Thanks,
Les



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
Excel formula to copy/paste formula needed please. colwyn Excel Discussion (Misc queries) 4 October 22nd 08 11:27 PM
Formula Help Needed KC Excel Discussion (Misc queries) 4 July 18th 08 09:07 PM
needed formula Mikey[_2_] Excel Worksheet Functions 4 December 19th 07 12:56 AM
Formula needed William@Target[_2_] Excel Worksheet Functions 2 March 16th 07 05:08 PM
Formula Help Needed BDY Excel Discussion (Misc queries) 3 October 26th 05 05:35 PM


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