In this case, attendance is a requirement mandated from above. You could ask for clarification from the powers that be who set the rule. For example, you could ask ... Is attendance to be recorded at the start, middle, or end of class? In other words, you could push the decision process back up the chain from where it came.
This approach is likely best done only when you have lots of free time, you have a thick skin, and you just want to annoy your superiors.
The inference is that you have the freedom to define your approach to how you record attendance. Dissecting each of your options, I might see them this way ...
1) You record attendance at the end of class
2) You record attendance at the start or end of class AND either do not ask the latecomers for excuses or ask the latecomers for excuses that you then ignore anyway
3) You record attendance at the start or end of class AND ask the latecomers for excuses AND try to parse the excuses based on a matrix that relies on other potentially unclear and arbitrary rules AND use an on-the-spot decision from that ruling to erase attendance
4) You record attendance at the start of class AND shut out latecomers from even entering the class which only serves to annoy the "honest latecomers", stoke your ego, and count attendance twice because the latecomers may also be shut out of the final exam
I hope that, with this analysis, you see the excess overhead and futility of using options 2-4.
Let's presume that you do not have the option to IGNORE taking attendance. Perhaps for example you are mandated to make a report that proves that you did record attendance in some manner. In this case, I suggest, with the freedom that you have to define attendance, you have perhaps two different approaches.
Attendance Means You Were Here for a Certain Portion of the Lecture
Record attendance at a certain point in time near start of class or near the end of the class and then be done with it. Latecomers should be allowed a certain grace, for example perhaps either to the middle of class. After that grace, they can show up but they will be recorded as having been absent. In addition, if students leave after you take attendance, they will still be recorded as having been present. Attendance then becomes a consistent message, both in what it means and in when it is recorded. You don't bother yourself with policing attendance on-the-spot, either by parsing excuses, by shutting out latecomers, or by glaring at early-leavers.
When you would do as above, figure out how you will handle students who ARE late yet will try to say "I was there by the time the attendance was recorded and you missed me." On the other side, you will have to accept that you allow students to leave with no penalty after attendance is taken. The clicker system that is oft-used in US classrooms can be a great resource for taking attendance ... With due diligence, it should not be easily cheated. Other methods have their pros and cons.
In the end, whatever you decide to handle such cases, keep it simple and consistent.
Attendance Means You Were Here at the Time the Lecture Started or by the Time the Lecture Ended (PERIOD)
Record attendance either at the start or at the end of he lecture and be done with it. The message again is consistent ... be here at the start or be here at the end.
Summary
When the rule is only that you take attendance, whatever you do, keep it simple and be consistent. Avoid trying to close every loophole with yet more regulations and oversight.