• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

DATEDIF: XL 2021 Better Concise Alternative? Instead of concertina string together mess

Stephan

Member
Hello

OBJECTIVE: Best method for simple, basic & concise way to calc:

DATE DIFFERENCE between 2 DATES displayed in:
YEAR - MONTH - DAY - HOUR - MIN

QUESTION:
Surely there must be a better way of calculating DATE DIFFERENCES of:

2 DATE:TIME CELLS in XL 2021 and/or 365 to calc, other then using DATEDIF? Unless it a much abbreviated version, then old layout..

So far best suggestion is CONCATE DATEIF, which is @ btm of this post, all in 1 cell visible to, not all folded under in cascading lines...

Please see attached Spreadsheet & Screen-Shot for clarification, what I'm asking for, which in a Spreadsheet is far more obvious then Words in Black&White etc.

1. DATES SUBTRACTED, but is incorrect with current FORMULA & FORMAT CELLS, yes I did try BRACKETS on HOURS… [HH] but was not right…either..!


FORMAT CELLS CUSTOM:
yy "Yr" m "Mth" d "Day" hh:mm


See CELL E5 in RED for ERROR, & compare with correct DATE+TIME calc in F3.


2. DATEDIF I recognise exists & probably the long term solution, but it is very very REPETITIVE, re-quoting CELLS REFs again & again, and when strung concertina together in 1CELL, it is complicated to follow, hence fraught with likely human error when used elsewhere, appreciate you might say…this is the way to do it & want u want to get it all in 1 and to display in 1 cell string together, or add it together from separates is easy to edit. E.G:

A.

1 CELL: F13

=DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"y")&" Year "&DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"ym")&" Mth "&INT(DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"md")/7)&" Wk "&MOD(DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"md"),7)&" Day "&TEXT(B1-A1,"h"" Hr "" m"" Min "" s"" Sec""")

Or

B.

SEPARATE CELLS:

YEAR:
CELL E10
=DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"y")&" Year "

MTH: CELL F10
=DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"ym")&" Mth "

WK: CELL G10
=INT(DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"md")/7)&" Wk "

DAY: CELL H10
=MOD(DATEDIF(A1,B1 -(MOD(A1,1)>MOD(B1,1)),"md"),7)&" Day "

HOUR:MIN: CELL I10
=TEXT(B1-A1,"h"" Hr "" m"" Min """)

ADD TOGETHER: CELL F11
=E10&F10&G10&H10&I10

3. CONCATE DATEDIF
=CONCAT(DATEDIF(A1,B1,{"y","ym","md"})&{" Year "," Mth "," Day "})&TEXT(B1-A1,"H""Hr"" M""M""")

And appreciate my perspective if was way for SIMPLE/BASIC SUBRTRACT to calc correct that would be best.
If not, choice between the original DATEDIF separates, or tbh the suggested CONCATE DATEDIF is prob best…

But... surely in this day & age, there must be other ways? Or even a better way, or ways!

Realistically doubt any1 will better the CONCATE DATEIF though!

Cheers Stephan

DateDif Screen-Shot.png
CROSS THREADS?:

https://www.excelforum.com/excel-fo...certina-string-together-mess.html#post6042739

https://www.myonlinetraininghub.com...ve-instead-of-concertina-string-together-mess
 

Attachments

So... CONCATE DATEIF is probably as good as it gets, unless some of you, an XL GENIUS have better ideas? But what about a simple/basic subtract..???


Subtract: B1-A1


FORMAT CELLS CUSTOM: yy "Yr" m "Mth" d "Day" hh:mm



But DATE is in ERROR. Partially right / Partially wrong...NUMBER of DAYS is WRONG!

What would be right, tried [HH] and after some humming (mmm) those BRACKETS made absolutely no different (It wasn't.. That..) turns out that not right... either..

Cheers
 
Back
Top