[Solved] Count Fridays in current month

Discuss the spreadsheet application

[Solved] Count Fridays in current month

Postby killerpip4 » Tue Jan 28, 2020 5:53 pm

hi ive looked around the forums but i can not find a solution to my problem.

im trying to basicly times a cost (£32.50) by the number of fridays in the current month (automatically) and i have tried different ways of using the time and date functions but no luck

if anyone could help it would be very appreciated

Thank you very much MrProgrammer for the help.
Last edited by killerpip4 on Tue Jan 28, 2020 6:52 pm, edited 2 times in total.
open office 4.1.1
killerpip4
 
Posts: 3
Joined: Thu Oct 22, 2015 1:07 am

Count Fridays in current month

Postby MrProgrammer » Tue Jan 28, 2020 6:31 pm

killerpip4 wrote:im trying to basicly times a cost (£32.50) by the number of fridays in the current month (automatically)
The number of Fridays in the current month is
=SUMPRODUCT(6=WEEKDAY(DATE(YEAR(TODAY());MONTH(TODAY());ROW(OFFSET($A$1;0;0;DAYSINMONTH(TODAY());1)))))

OFFSET creates an array from A1 to A28/A29/A30/A31 as appropriate. ROW creates an array from 1 to 28/29/30/31. DATE creates the desired dates. WEEKDAY gets their day of the week. SUMPRODUCT counts how many of those are 6 (Friday).

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the title. You can select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3952
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA


Return to Calc

Who is online

Users browsing this forum: No registered users and 24 guests