The expression 06/05/2021
is not a date but a quotient whose value is 6 divided by 5 divided by 2021, e.g., 0.0005937654626
.
Since the question was posted on 6 May 2021, I am assuming that you want to express the date 2021-05-06
. To get a dateserial value, replace the hard-coded value with a reference to a cell that contains a date, or use an expression like value("2021-05-06")
, as in the following examples.
Get the maximum High
and the minimum Low
for a single day:
=query(
googlefinance("NSE:INFY", "all", value("2021-05-06")),
"select max(Col3), min(Col4)",
1
)
Get the maximum High
and the minimum Low
for a calendar month:
=query(
googlefinance(
"NSE:INFY",
"all",
value("2021-05-06"),
day(eomonth(value("2021-05-06"), 0))
),
"select max(Col3), min(Col4)",
1
)
As said, this is usually done by using a reference to a cell that contains a date, rather than using a hard-coded value embedded in the formula, like this:
=iferror(
query(
googlefinance(
"NSE:" & A2,
"all",
G2,
H2 - G2 + 1
),
"select max(Col3), min(Col4)
label max(Col3) '', min(Col4) '' ",
1
),
"(no data for '" & A2 & "' " & trim(G2) & " - " & trim(H2) & ")"
)
See this answer for an explanation of how date and time values work in spreadsheets.