- Tham gia
- 12/6/06
- Bài viết
- 3,184
- Được thích
- 7,633
Mọi người có ai đã từng thấy công thức như vậy chưa, không biết trong excel có không, phải nói là khủng khiếp
=ArrayFormula(max(query(transpose({query({N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col2-Col3"))},"select* offset 1"),query({abs(N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col2-Col4")))},"select* offset 1"),query({abs(N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col3-Col4")))},"select* offset 1")}),"select max(Col"&join(",max(Col",row(indirect("A1:A"&B3))&")"))))
=ArrayFormula(max(query(transpose({query({N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col2-Col3"))},"select* offset 1"),query({abs(N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col2-Col4")))},"select* offset 1"),query({abs(N(query({query({Googlefinance(A3,"High",today(),today()-(B3+6)),Googlefinance(A3,"low",today(),today()-(B3+6))},"select Col1,Col2,Col4 order by Col1 desc limit "&B3&" "),query(Googlefinance(A3,"close",today(),today()-(B3+6)),"select Col2 order by Col1 desc limit "&B3&" offset 1 label Col2 'closeyest' ")},"select Col3-Col4")))},"select* offset 1")}),"select max(Col"&join(",max(Col",row(indirect("A1:A"&B3))&")"))))