Day of the week in a year

Juggler_IN

Active Member
Joined
Nov 19, 2014
Messages
347
Office Version
  1. 2003 or older
Platform
  1. Windows
I want to compute the value for the "day of the week in a year." For example, Today (7th August) is Friday number 32 out of 52 Fridays in 2020. How do I get this value using a UDF?
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
UDF, formula or plain vba?

The basic principle is INT((today-n)/7)+1 where n refers to Jan 1st of the current year.

edit:- @gaz_chops, this is the original, the other one is the duplicate (posted later).
 
Upvote 0
@jasonb75 Oops, my bad

My reply from the other thread -

If a formula is acceptable, you can try

=WEEKNUM(A1)

You can tweak as to when the year starts/week starts.
 
Upvote 0
I need a UDF to give me which DOW is it and what is the current count out of total counts for the year. Eg. there are 52 mondays, 52 tuesdays, but 53 wednesdays in 2020. So, what is want is, for a given "date," what day it is (Friday), x of y days (32nd Friday out of 52 Fridays in 2020).
 
Upvote 0
=SUMPRODUCT(--(TEXT(ROW(INDEX(A:A,DATE(YEAR(TODAY()),1,1),1):INDEX(A:A,TODAY(),1)),"ddd")="sat"))

will return the number of Saturdays that have been between the start of the year and today.

=SUMPRODUCT(--(TEXT(ROW(INDEX(A:A, DATE(YEAR(TODAY()),1,1) ,1):INDEX(A:A, DATE(YEAR(TODAY())+1,1,0) ,1)),"ddd")="sat"))
Will return the number of saturdays in the current year.
 
Upvote 0
Or this for number of days to date entered -

=WEEKNUM(A1,10+WEEKDAY(A1))
 
Upvote 0
Try this:

=NETWORKDAYS.INTL(DATE(YEAR(TODAY()),1,1),TODAY(),SUBSTITUTE(1111111,1,0,WEEKDAY(TODAY(),2)))
 
Upvote 0

Forum statistics

Threads
1,213,550
Messages
6,114,265
Members
448,558
Latest member
aivin

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