工作日标识动态公式需求:日历WD1至WD-8自动赋值求助
Got it, let's walk through this process step by step to make your manual tagging straightforward and error-free. Here's how to assign the labels exactly as you need:
Step 1: List all valid workdays first
Start by listing out every date in the month, then cross out Saturdays and Sundays. You'll end up with a clean list of only workdays—let's call the total number of these N for reference.
Step 2: Tag the first workday as WD1
Find the very first entry in your workday list, and mark it with WD1—that's your monthly starting point.
Step 3: Assign sequential labels for the middle workdays
Starting from the second workday (right after WD1), label each one with WD2, WD3, WD4, and so on. Keep going until you reach the (N-8)th workday in your list. This leaves exactly 8 workdays at the end for your reverse labels.
Step 4: Tag the last 8 workdays as WD-1 to WD-8
Now handle the final 8 workdays, working backwards from the end of your list:
- The last workday (Nth entry) gets
WD-1 - The second-to-last workday ((N-1)th entry) gets
WD-2 - Continue this pattern until the (N-7)th workday, which gets
WD-8
Example to make it concrete
Let's say a month has 22 total workdays (N=22):
- Workday 1:
WD1 - Workday 2:
WD2 - ...
- Workday 14:
WD14(since 22-8=14) - Workday 15:
WD-8 - Workday 16:
WD-7 - Workday 17:
WD-6 - Workday 18:
WD-5 - Workday 19:
WD-4 - Workday 20:
WD-3 - Workday 21:
WD-2 - Workday 22:
WD-1
This way, you'll have a seamless sequence from WD1 all the way through to WD-1, with no gaps or overlaps.
内容的提问来源于stack exchange,提问作者aicirtap

