Jun 09 2021 04:58 AM
hi all,
i want to create a sheet that follows some stocks and tells me every stock when it was at the highes price since it was added to the sheet. for that i'm using vlookup that works on a table from "stockhistory" function. somehow instead of getting the real date of the max price, i get the latest date. i used "evaluate formula" to try debugging what's wrong. the vlookup reached the table correctly but didnt fit between the max value to its date and i dont know why. i'm adding the debugging window.
Jun 09 2021 05:11 AM
SolutionJun 09 2021 05:13 AM
Jun 09 2021 05:24 AM
Yes
=LET(stock,STOCKHISTORY("msft",TODAY()-90,TODAY(),0,2,0,3),INDEX(stock,XMATCH(10000000000,INDEX(stock,,2),-1),{1,2}))
Jun 09 2021 05:25 AM
Could you please share the file with the sample?
Jun 09 2021 05:50 AM
the solution of index and xmatch works. didnt understand exactly how... andi dont know why vlookup didnt work
Jun 09 2021 05:57 AM
With XMATCH() we find position of max looking for any big number and returning position of it or next smaller number which will be our max. INDEX() returns data on this position.
Why doesn't VLOOKUP() work - hard to say without the sample.
Jun 09 2021 05:11 AM
SolutionAs variant
=INDEX(E2#,XMATCH(1e10,INDEX(E2#,,2),-1),{1,2})
on