Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Date formula that will return proper pay day

I need to set up a schedule that would list bi-monthly paydays based on the
15th and last workday of the month. When a pay day falls on a weekend or
holiday it must change to the last workday prior to the 15th or the last
workday of the month.

Is there a simple formula I can use to list what those paydays would be? My
formula goes on and on and I know there must be an easier way.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Date formula that will return proper pay day

On Wed, 24 Feb 2010 17:56:02 -0800, JJ in LA
wrote:

I need to set up a schedule that would list bi-monthly paydays based on the
15th and last workday of the month. When a pay day falls on a weekend or
holiday it must change to the last workday prior to the 15th or the last
workday of the month.

Is there a simple formula I can use to list what those paydays would be? My
formula goes on and on and I know there must be an easier way.


If I understand what you want:

With some date in the month of interest in A1:

The workday that is either the 15th of the month, or the first workday prior to
that date:

=WORKDAY(A1-DAY(A1)+16,-1,[holidays])

The last workday of the month:

=WORKDAY(DATE(YEAR(A1),MONTH(A1)+1,1),-1,[holidays])

[holidays] represents a range of cells where the holiday dates are stored.

If the function returns a #NAME error, and you are using a version prior to
Excel 2007, see HELP for the WORKDAY function for instructions as to how to
resolve the problem.
--ron
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Date formula that will return proper pay day

JJ -

1.) Enter the dates you want to analyze in column A (ie A1 is 1/15, A2 is
1/31)
2.) Enter the following in cell B1:

=IF(WEEKDAY(A2) = 1, A2 - 2, IF(WEEKDAY(A2) = 7, A2 - 1,A2))

3.) Make sure your cells are formatted as DATE
4.) Copy and paste the formula down

In this example, Jan 29 will display in cell B2 because Jan 31 falls on a
Sunday

---

The formula works as such: Analyzes the date and returns a serial
corresponding to the Day of the Week. 1 = Sunday, 2 = Monday, etc. If the
serial is 1, then subtract 2 days from the date to get to Friday, if the
serial is 7 (for Saturday) then subtract 1 day from the date to get to
Friday, otherwise leave the date unchanged.


"JJ in LA" wrote:


I need to set up a schedule that would list bi-monthly paydays based on the
15th and last workday of the month. When a pay day falls on a weekend or
holiday it must change to the last workday prior to the 15th or the last
workday of the month.

Is there a simple formula I can use to list what those paydays would be? My
formula goes on and on and I know there must be an easier way.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,651
Default Date formula that will return proper pay day

On Wed, 24 Feb 2010 18:43:01 -0800, Matt
wrote:

JJ -

1.) Enter the dates you want to analyze in column A (ie A1 is 1/15, A2 is
1/31)
2.) Enter the following in cell B1:

=IF(WEEKDAY(A2) = 1, A2 - 2, IF(WEEKDAY(A2) = 7, A2 - 1,A2))

3.) Make sure your cells are formatted as DATE
4.) Copy and paste the formula down

In this example, Jan 29 will display in cell B2 because Jan 31 falls on a
Sunday

---

The formula works as such: Analyzes the date and returns a serial
corresponding to the Day of the Week. 1 = Sunday, 2 = Monday, etc. If the
serial is 1, then subtract 2 days from the date to get to Friday, if the
serial is 7 (for Saturday) then subtract 1 day from the date to get to
Friday, otherwise leave the date unchanged.


Note that your method does not correct for holidays.
--ron
  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 516
Default Date formula that will return proper pay day

Thanks for pointing that out, Ron.

"Ron Rosenfeld" wrote:

On Wed, 24 Feb 2010 18:43:01 -0800, Matt
wrote:

JJ -

1.) Enter the dates you want to analyze in column A (ie A1 is 1/15, A2 is
1/31)
2.) Enter the following in cell B1:

=IF(WEEKDAY(A2) = 1, A2 - 2, IF(WEEKDAY(A2) = 7, A2 - 1,A2))

3.) Make sure your cells are formatted as DATE
4.) Copy and paste the formula down

In this example, Jan 29 will display in cell B2 because Jan 31 falls on a
Sunday

---

The formula works as such: Analyzes the date and returns a serial
corresponding to the Day of the Week. 1 = Sunday, 2 = Monday, etc. If the
serial is 1, then subtract 2 days from the date to get to Friday, if the
serial is 7 (for Saturday) then subtract 1 day from the date to get to
Friday, otherwise leave the date unchanged.


Note that your method does not correct for holidays.
--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
Formula to return tomorrow's date. Shadyhosta New Users to Excel 6 April 4th 23 11:20 AM
Is there a formula that will return only the month from a date? birdgirl31 Excel Discussion (Misc queries) 5 July 4th 09 08:48 AM
how do i return to normal text from =PROPER(cell) showsomeidnow Excel Discussion (Misc queries) 3 April 30th 07 12:50 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 06:07 PM
Date formula: return Quarter and Fiscal Year of a date Rob Excel Discussion (Misc queries) 7 May 11th 05 09:48 PM


All times are GMT +1. The time now is 10:23 AM.

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"