I have excel from office professional 2016 .
I am trying to calculate the number of weeks between today's date and a task start date (expressed as an integer). Any help would be appreciated.
I have excel from office professional 2016 .
I am trying to calculate the number of weeks between today's date and a task start date (expressed as an integer). Any help would be appreciated.
How about this?
=($A$5-C11)/7
Ali
Enthusiastic self-taught user of MS Excel who's always learning!
Don't forget to say "thank you" in your thread to anyone who has offered you help.
You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.
Forum Rules (updated August 2023): please read them here.
thanks Ali. I was sure that wasn't before!
Please define "number of weeks"=INT((TODAY()-C11)/7)
You might want to ROUND the result, as your last entry (which is 13 days ago) will show 1, like this in D11:
=ROUND((($A$5-C11)/7),0)
and if your date is in the future you will get a negative result, so you might want to do this to prevent that:
=MAX(ROUND((($A$5-C11)/7),0),0)
Hope this helps.
Pete
thanks Pete. That works well.
Glad to help, and thanks for the rep.
Pete
thanks BMV. Interestingly the no. days between today and a start date of 01Oct2018 was one day more using Ali's solution above. The others were the same.
An alternative means is with Power Query which seems a bit more convoluted but is here only as a learning option.
Power Query is a free AddIn for Excel 2010 and 2013, and is built-in functionality from Excel 2016 onwards (where it is referred to as "Get & Transform Data").let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content], #"Changed Type" = Table.TransformColumnTypes(Source,{{"Task ", Int64.Type}, {"Column1", type any}, {"start date ", type date}}), #"Added Custom" = Table.AddColumn(#"Changed Type", "Today", each DateTime.Date(DateTime.LocalNow())), #"Added Custom1" = Table.AddColumn(#"Added Custom", "Custom", each [Today]-[#"start date "]), #"Added Custom2" = Table.AddColumn(#"Added Custom1", "Custom.1", each [Custom]/7), #"Changed Type1" = Table.TransformColumnTypes(#"Added Custom2",{{"Custom.1", Int64.Type}}), #"Removed Columns" = Table.RemoveColumns(#"Changed Type1",{"Today", "Custom"}) in #"Removed Columns"
It is a powerful yet simple way of getting, changing and using data from a broad variety of sources, creating steps which may be easily repeated and refreshed. I strongly recommend learning how to use Power Query - it's among the most powerful functionalities of Excel.
- Follow this link to learn how to install Power Query in Excel 2010 / 2013.
- Follow this link for an introduction to Power Query functionality.
- Follow this link for a video which demonstrates how to use Power Query code provided.
Alan עַם יִשְׂרָאֵל חַי
Change an Ugly Report with Power Query
Database Normalization
Complete Guide to Power Query
Man's Mind Stretched to New Dimensions Never Returns to Its Original Form
thanks Alan,
I still a novice at Excel. Also I couldn't open the links. I am sure I will use Power Query as I get to grips with Excel. Thank you.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks