unsolved
I want to calculate how many days I was out of the country for.
I want to calculate how much I have been out of the country for each year i already have the comings and goings in a chart.
(above is when I went in and out)
my problem with doing it in a function is when I wasn't home for the new year so I cant separate the days to the correct year. (like in entry number 3)
The result above I counted manually which I can't really do because I have to this for hundreds of people which go in and out more than me.
Thank You Very Much for your kind words, I appreciate the same. So, for your question the logic is using _c > _a, is the departure day isn't counted, since you're still in the country for part of the day. Using >= would count both the departure and the return days. Either works, you need to pick the rule you want and apply it accordingly per your suit.
Edit: Sorry, I just realized you're not the OP, kindly ignore my earlier comment about Solution Verified. Thanks!
Assuming you are using Excel 2021+ then try one of the following methods, these are dynamic array formula which will spill for the entire array, so no need to copy down:
Decronym is now also available on Lemmy! Requests for support and new installations should be directed to the Contact address below.
Beep-boop, I am a helper bot. Please do not verify me as a solution. [Thread #49513 for this sub, first seen 13th Oct 2026, 22:19][FAQ][Full list][Contact][Source code]
How do you want to count, are you including the start date or the end date (or both)? The following counts the end date but not the start, you can adjust the >= and <= as required
if you want to exclude either the start date or end date (or both) from the calculation, just enter how many days you wanna subtract from the calculations in A1; e.g. if you put 2 in A1 then you're basically excluding the start date and end date from the count.
DAYS doesn't separate the total days into the correct year when an entry spans two years. As OP put it:
my problem with doing it in a function is when I wasn't home for the new year so I cant separate the days to the correct year. (like in entry number 3)
And asking hundreds of people to change how they report isn't a winning move.
•
u/AutoModerator 2d ago
/u/RoniTheRoni - Your post was submitted successfully.
Solution Verifiedto close the thread.Failing to follow these steps may result in your post being removed without warning.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.