Years, Months, Weeks, Days

Robert Wyatt

Board Regular
Joined
Jul 15, 2012
Messages
88
Office Version
  1. 2019
Platform
  1. Windows
trying to write a formula to give years, months, weeks, and days, but having a little trouble could someone tell me how to do this including a sample of what I'm working on, I have formulas in the Years, Months, Days box's , but weeks is where I'm having my trouble can someone help?

Book1
F
610
Sheet1
Cell Formulas
RangeFormula
F6F6=IF(B6="","",(DATEDIF(B6,TODAY(),"MD")))
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Sort of unsure what you're asking for. Your mini sheet really doesn't give any insight to your question. Can you show the starting values and expected results?

But, here are two ways that may help....

Or are you asking for week number of the year?

Also, what constitutes a week in your scenario? Any day in a new week? What day does your week counting start with?


Book1
ABCDEFG
1
2Start DateEnd Date# MondaysInteger of Div 7
3Tue 2023-05-16Wed 2023-05-1700
4Tue 2023-05-16Mon 2023-05-2210
5Tue 2023-05-16Mon 2023-05-2921
6Tue 2023-05-16Thu 2023-06-1544
7Tue 2023-05-16Mon 2023-07-311110
8Tue 2023-05-16Mon 2024-05-135251
9Tue 2023-05-16Thu 2024-05-165252
Sheet1
Cell Formulas
RangeFormula
F3:F9F3=NETWORKDAYS.INTL(D3,E3,"0111111")
G3:G9G3=INT((E3-D3)/7)
 
Upvote 0
Sorry hopefully this will clear things up



Book1
BCDEF
7Hire In DateYearsMonths WeeksDays
82/4/200815610
Sheet1
Cell Formulas
RangeFormula
C8C8=IF(B8="","",(DATEDIF(B8,TODAY(),"Y")))
D8D8=IF(B8="","",(DATEDIF(B8,TODAY(),"YM")))
F8F8=IF(B8="","",(DATEDIF(B8,TODAY(),"MD")))
 
Upvote 0
I'm really unsure of your ultimate objective.
But, here are a few ideas... maybe you can work them into what you want...


Book1
ABCDEF
1
2
3
4
5
6
7Hire In DateYearsMonths WeeksDays
82008-02-0415611
9Counting Mondays811
10Days Divided by 7, rounded down810
11Weeks Since Last "montheversary"14
12
13
Sheet1
Cell Formulas
RangeFormula
C8C8=IF(B8="","",(DATEDIF(B8,TODAY(),"Y")))
D8D8=IF(B8="","",(DATEDIF(B8,TODAY(),"YM")))
F8F8=IF(B8="","",(DATEDIF(B8,TODAY(),"MD")))
E9E9=NETWORKDAYS.INTL(B8,TODAY(),"0111111")
E10E10=INT((TODAY()-B8)/7)
E11E11=INT((TODAY()-DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(B8)))/7)
F11F11=TODAY()- (DATE(YEAR(TODAY()),MONTH(TODAY()),DAY(B8))+7*E11)
 
Upvote 0
Solution
what I'm looking to do is to give how many years, months, weeks, and days I have been employed. I have all about the weeks figured out. what you have shown me isn't quite what I was hoping for.
I well just keep trying to figure it out on my own.
 
Upvote 0
well, how do you define a year, month, and week?
Is 1 year every anniversary of 2/4/2008? From there how do you calculate a month - is it every 2nd of April (or 4th of February)? and is weeks based up the most recent monthiversary? - If so, I thought I was pretty close to what I have on Row 11 for weeks and days.

What is your expectation for today August 16, 2023?
 
Upvote 0

Forum statistics

Threads
1,223,227
Messages
6,170,848
Members
452,361
Latest member
d3ad3y3

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