Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel: take one date from another, display as weeks & days? 1

Status
Not open for further replies.

andywing

Technical User
Nov 15, 2001
10
GB
In Excel 2000

April 1, 2005 - March 10, 2005 = 22

I want this to display the 22 as 3 weeks 1 day(s)

I think that makes sense!

Is this easy?



Andy Wing
Local Government - Systems Administrator
England
 

hi,

[tt]
a1 = 22
weeks: =int(A1/7)
Days: =mod(A1,7)
[/tt]


Skip,

[glasses] [red]Be advised:[/red] When you ignite a firecracker in a bowl of vanilla, chocolate & strawberry ice cream, you get...
Neopolitan Blownapart! [tongue]


 
Assuming A1 is greater of the two dates and B1 is the lesser:

=int((A1-B1)/7)&" weeks " &(A1-B1)- int((A1-B1)/7)*7&" day(s)"

Mike
 
After seeing Skip's solution - The mof function would be much easier:

=TRUNC((A1-B1)/7)&" weeks " &MOD((A1-B1),7)&" day(s)"

Mike
 
Thank you Mike (mbarron) that works a treat, there's no way that I would have got there!

Brilliant!

Andy Wing
Local Government - Systems Administrator
England
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top