+ Reply to Thread
Results 1 to 16 of 16

Determining how many days between dates fall within a specified duration and how many

  1. #1
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Determining how many days between dates fall within a specified duration and how many

    Hi everyone,

    I am currently trying to obtain permanent residence in Australia. While this might seem by-the-by, what is interesting is that there are various timing requirements in order to keep certain visas valid. I imagine this is common to most visa systems around the world.

    I have tried for hours how I can work out from the attached whether this condition is satisfied:

    The candidate for permanent residence must have lived in Australia for 2 years (730 days) in the last 5 years


    I suspect the answer will involve a logic formula to see if either arrival or departure date are more recent than 5 years old, and also a sumif(s) to ensure only dates against Australia are analysed.

    How, using formula, would it be possible to have a yes/no for the above by interrogating the data? I'm aware the answer is no based on the above, but it will become yes as time goes on. Also, how can I predict the first date that the answer will become yes?

    Please let me know if you have any ideas how to solve this one?
    Attached Files Attached Files
    Last edited by tomca; 05-18-2019 at 02:53 AM.

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,447

    Re: Date testing in line with Australian permanent residency obligations

    New title much better. Thanks
    Last edited by Pepe Le Mokko; 05-18-2019 at 03:00 AM.

  3. #3
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52
    My mistake - sorted
    Last edited by AliGW; 05-18-2019 at 02:59 AM.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Determining how many days between dates fall within a specified duration and how many

    I'm aware the answer is no based on the above, but it will become yes as time goes on.
    There is no point providing sample data that will not provide the result you are looking for, as we can't test any proposals.

    Please provide sample data that we can use to solve the issue. Thanks.

    Also, how can I predict the first date that the answer will become yes?
    How would you predict this yourself? What would your criteria be?
    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.

  5. #5
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,830

    Re: Determining how many days between dates fall within a specified duration and how many

    This will work out length of stay for each row (D2 copied down):

    =DATEDIF(B2,C2,"d")

    Change C2 to:

    =TODAY()

    Then have a play with this:

    =SUMIFS($D$2:$D$10,$A$2:$A$10,"Australia",$C$2:$C$10,"<="&TODAY()-730)

    Hopefully this will get you started.
    Last edited by AliGW; 05-18-2019 at 03:17 AM.

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,052

    Re: Determining how many days between dates fall within a specified duration and how many

    If the period of residency straddles today-5 years it gets a bit messier. One approach might be this:

    =MAX(IF(B2< EDATE(TODAY(),-60),C2-EDATE(TODAY(),-60),IF(A2< > "Australia",0,IF(ISNUMBER(C2),C2-B2,TODAY()-B2))),0)

    to calculate eligible days and then just add them up. see sheet.
    Attached Files Attached Files
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  7. #7
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Re: Determining how many days between dates fall within a specified duration and how many

    Quote Originally Posted by Glenn Kennedy View Post
    If the period of residency straddles today-5 years it gets a bit messier. One approach might be this:

    =MAX(IF(B2< EDATE(TODAY(),-60),C2-EDATE(TODAY(),-60),IF(A2< > "Australia",0,IF(ISNUMBER(C2),C2-B2,TODAY()-B2))),0)

    to calculate eligible days and then just add them up. see sheet.
    Hi Glenn,

    Thank you for this.

    Could you please double check D12 as this throws a figure higher than zero which should be zero.

    Also is it possible to do this without the helper column?
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Determining how many days between dates fall within a specified duration and how many

    I cannot post the formula.

    Please see the attachment.
    Attached Files Attached Files
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  9. #9
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Re: Determining how many days between dates fall within a specified duration and how many

    Quote Originally Posted by mehmetcik View Post
    I cannot post the formula.

    Please see the attachment.
    Thank you, is it possible to amend so this only adds up qualifying durations in Australia?

  10. #10
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Determining how many days between dates fall within a specified duration and how many

    Please try

    =SUM((A2:A10="Australia")*(EDATE(TODAY(),-60)<B2:B10)*(IFERROR(--C2:C10,TODAY())-B2:B10))
    and Press Ctrl+Shift+Enter
    Attached Files Attached Files

  11. #11
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Determining how many days between dates fall within a specified duration and how many

    My Mistake.
    Attached Files Attached Files

  12. #12
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Re: Determining how many days between dates fall within a specified duration and how many

    Quote Originally Posted by Bo_Ry View Post
    Please try

    =SUM((A2:A10="Australia")*(EDATE(TODAY(),-60)<B2:B10)*(IFERROR(--C2:C10,TODAY())-B2:B10))
    and Press Ctrl+Shift+Enter
    This is 99% perfect thank you.

    The only other tweak is to add 1 day to each line that is added up because, for example:

    Travel to Arrival date Departure date Duration
    Australia 19/05/2019 19/05/2019 1

    I.e. the arrival and departure dates are the same, but it would still count as 1 day in Australia because it wouldn't count as zero days. So every summed row requires an additional 1 day.

  13. #13
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Determining how many days between dates fall within a specified duration and how many

    Then try this with Ctrl+Shift+Enter

    =SUM((A2:A10="Australia")*(EDATE(TODAY(),-60)<B2:B10)*(IFERROR(--C2:C10,TODAY())-B2:B10+1))

  14. #14
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Re: Determining how many days between dates fall within a specified duration and how many

    Quote Originally Posted by mehmetcik View Post
    My Mistake.
    Thank you.

    Quote Originally Posted by Bo_Ry View Post
    Then try this with Ctrl+Shift+Enter

    =SUM((A2:A10="Australia")*(EDATE(TODAY(),-60)<B2:B10)*(IFERROR(--C2:C10,TODAY())-B2:B10+1))
    Thank you. Exactly what I was after.

  15. #15
    Forum Guru Bo_Ry's Avatar
    Join Date
    09-10-2018
    Location
    Thailand
    MS-Off Ver
    MS 365
    Posts
    7,211

    Re: Determining how many days between dates fall within a specified duration and how many

    Better use this with Ctrl+Shift+Enter
    if Arrival date is before 5 years, above formula count it as 0 as in row 9.

    =SUM(--TEXT((A2:A10="Australia")*(IFERROR(--C2:C10,TODAY())-IF(EDATE(TODAY(),-60)<B2:B10,B2:B10,EDATE(TODAY(),-60))+1),"0;\0;0"))
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    09-09-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2019
    Posts
    52

    Re: Determining how many days between dates fall within a specified duration and how many

    Thank you, this is really good

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 03-21-2015, 08:19 AM
  2. Need permanent target line on a chart with data that changes weekly
    By bnurmi in forum Excel Charting & Pivots
    Replies: 4
    Last Post: 02-01-2014, 07:22 AM
  3. Replies: 7
    Last Post: 08-06-2013, 11:13 AM
  4. Problem with US/Australian date formatting
    By george_g in forum Excel General
    Replies: 2
    Last Post: 03-23-2011, 07:36 PM
  5. US to Australian date conversion
    By clj123 in forum Excel General
    Replies: 1
    Last Post: 10-13-2006, 02:38 AM
  6. australian date format
    By Karline in forum Excel General
    Replies: 1
    Last Post: 03-23-2006, 08:35 PM
  7. [SOLVED] Opening a csv file with US date format on a Australian PC
    By Troy Lea in forum Excel General
    Replies: 3
    Last Post: 03-16-2005, 08:13 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1