简体   繁体   English

日期从周数和工作日名称

[英]Date From Week Number & Week Day Name

Is it Possible to get the Date from the given Week Number and the Day Name?是否可以从给定的周数和日期名称中获取日期?

for Example if the below criteria matches then the outcome would the a date例如,如果以下条件匹配,则结果将是日期

   Year: 2019
   Week Number: 45
   Day Name: Friday
   Outcome: 8/11/19

How is this possible?这怎么可能?

Try this formula:试试这个公式:

=DATE(B1,1,1)+(B2-1)*7+MATCH(B3,{"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"},0)-WEEKDAY(DATE(B1,1,1)+(B2-1)*7,2)

See this picture for the meaning of input cells:输入单元格的含义见这张图:

在此处输入图像描述

Suppose that you've three columns假设你有三列

  1. Year at A2 A2年
  2. Week Number at B2 B2的周数
  3. Day Number at C3 C3天数

    You can use following formula to get exact date您可以使用以下公式来获取确切的日期

    =DATE(A2, 1, C2-3) - WEEKDAY(DATE(A2, 1, 3)) + B2 * 7 =日期(A2, 1, C2-3) - 工作日(日期(A2, 1, 3)) + B2 * 7

在此处输入图像描述

Note!笔记! This formula is based on ISO week numbers, with a week starting on Monday此公式基于 ISO 周数,一周从星期一开始

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM