Excel:如何返回上一个工作日的数据?

huangapple go评论121阅读模式
英文:

Excel: how to return data of the last weekday?

问题

以下是提取前一个工作日数据(B列)的公式:

=INDEX(B2:B5,MATCH(WORKDAY(TODAY(),-1),A2:A5,1))

这个公式将根据今天的日期,查找前一个工作日的数据。如果你在星期一打开文件(4月17日),公式将返回1。如果你在星期二打开文件(4月18日),公式将返回80。希望这有所帮助。

英文:
| Column A | Column B |
| 14/4     | 1        |
| 15/4     | 100      |
| 16/4     | 70       |
| 17/4     | 80       |

What is the formula I could use to extract the data (column B) of previous weekday please?
So if I open the file on monday (17 april), formula should return 1. If I open the file on tuesday (18 apr), formula should return 80.

Thanks in advance for your help.

答案1

得分: 2

使用在A1:B6范围内的数据,使用公式=XLOOKUP(WORKDAY(TODAY(),-1),$A$1:$A$6,$B$1:$B$6)

Excel:如何返回上一个工作日的数据?

WORKDAY

英文:

With your data in A1:B6 use the formula =XLOOKUP(WORKDAY(TODAY(),-1),$A$1:$A$6,$B$1:$B$6)

Excel:如何返回上一个工作日的数据?

WORKDAY

huangapple
  • 本文由 发表于 2023年4月6日 20:00:02
  • 转载请务必保留本文链接:https://go.coder-hub.com/75949282.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定