GoogleFinace convert dd/mm/yy to yy,mm,dd format

时间:2016-03-04 18:17:51

标签: google-sheets

I am trying to use blew expression in Google SpreadSheet.

=min(GoogleFinance("HKDUSD","price",date(A2)-1,date(A2)))

But since A2 data is in mm/dd/year format, we need to convert it to yy,mm,dd format as parameter of date().Does Google SpeadSheet has some API to do such convert?

1 个答案:

答案 0 :(得分:1)

如果您只是添加日期而不包含日期函数

,它实际上是有效的
=min(GoogleFinance("HKDUSD","price",L1-1,L1))

enter image description here

已编辑:要回答有关日期格式的后续问题 - 您使用正则表达式替换的公式解决方法,基本上只需使用此正则表达式按月交换两个捕获组"(\ w +)/(\瓦特+)":

=min(GoogleFinance("HKDUSD","price",REGEXREPLACE(L1,"(\w+)/(\w+)","$2/$1")-1,REGEXREPLACE(L1,"(\w+)/(\w+)","$2/$1")))
相关问题