Last Saturday of the Month

AdminCo

Board Regular
Joined
Jun 13, 2003
Messages
82
Hello,

I am trying to get cell A4 to return the last Saturday of the month based on the date in cell A1 being the month i.e. September 01, 2003. Then in cell A2 to show the Friday just over one week before the last Saturday (8 days).

Cell A1 = September 1, 2003 (Entered)
Cell A2 = September 19, 2003 (Formula)
Cell A4 = September 27, 2003 (Formula)

Any help would be appreciated.

Thanks,
Alan
 
In A2 enter:

=A4-8

In A4 enter:

=A1+7-WEEKDAY(A1)+(7<WEEKDAY(A1))*7+(4-1)*7

where 7 stands for Saturday and 4 4th Saturday.
 
Upvote 0
Hello Aladin,

Thanks for your response Aladin. I understand Cell A2 looking at Cell A4 and backing up 8 days. So if Cell A4 equalled Sep 27 then Cell A2 would be 8 days less producing Sep 19.

What I am not sure is the formula in cell A4. Cell A4 is looking at Cell A1 which in the example is showing Sep 1, 2003. Somehow cell A4 needs to find the last Saturday of the month based on the first of a given month. In 2003 there are four months that have five Saturdays instead of four. What would have to be done for the formula in cell A4 to find the last Saturday of any given month in any given year where if could be four or five Saturdays in a month? Would "eomonth" maybe have to be used?
 
Upvote 0
AdminCo said:
Hello Aladin,

Thanks for your response Aladin. I understand Cell A2 looking at Cell A4 and backing up 8 days. So if Cell A4 equalled Sep 27 then Cell A2 would be 8 days less producing Sep 19.

What I am not sure is the formula in cell A4. Cell A4 is looking at Cell A1 which in the example is showing Sep 1, 2003. Somehow cell A4 needs to find the last Saturday of the month based on the first of a given month. In 2003 there are four months that have five Saturdays instead of four. What would have to be done for the formula in cell A4 to find the last Saturday of any given month in any given year where if could be four or five Saturdays in a month? Would "eomonth" maybe have to be used?


A4 houses:

=A1+7-WEEKDAY(A1)+(7 < WEEKDAY(A1))*7+(4-1)*7
 
Upvote 0
Sorry Aladin. If I put November 1, 2003 in cell A1 it returns November 22 in cell A4 and November 14 in cell A2. What I need it to return is Nov 29 in cell A4 and Nov 21 in cell A2. I am trying to find the last Saturday of the month in order to have the formula work... :pray: :banghead: :pray:
 
Upvote 0
AdminCo said:
Sorry Aladin. If I put November 1, 2003 in cell A1 it returns November 22 in cell A4 and November 14 in cell A2. What I need it to return is Nov 29 in cell A4 and Nov 21 in cell A2. I am trying to find the last Saturday of the month in order to have the formula work... :pray: :banghead: :pray:

=A1+7-WEEKDAY(A1)+(7 < WEEKDAY(A1))*7+(SUMPRODUCT(--(WEEKDAY(ROW(INDIRECT(A1&":"&EOMONTH(A1,0))))=7))-1)*7
 
Upvote 0
Not the most elegant, but it seems to work:

=SUM(IF(WEEKDAY(EOMONTH(A1,0)-{0,1,2,3,4,5,6})=7,EOMONTH(A1,0)-{0,1,2,3,4,5,6}),0)

--Tom
 
Upvote 0
Hello Aladin,

If I enter =a1+7-WEEKDAY(a1)+(7) in cell A4 the date produced in cell A4 is November 8th thus making cell A2 return October 31. I'm not clear what I am supposed to do as the date in cell A4 should reflect November 29 which is the last Saturday in November 2003 and November 21 in cell A2 which is the week before on the Friday.

Alan
 
Upvote 0
AdminCo said:
Hello Aladin,

If I enter =a1+7-WEEKDAY(a1)+(7) in cell A4 the date produced in cell A4 is November 8th thus making cell A2 return October 31. I'm not clear what I am supposed to do as the date in cell A4 should reflect November 29 which is the last Saturday in November 2003 and November 21 in cell A2 which is the week before on the Friday.

Alan

See the edited post. Also Tom's.
 
Upvote 0

Forum statistics

Threads
1,226,799
Messages
6,193,069
Members
453,773
Latest member
bclever07

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top