A
A
arr0w2020-05-23 15:18:47
Google Sheets
arr0w, 2020-05-23 15:18:47

How to substitute the date in the formula?

There is a link that parses the dollar rate from the Central Bank website:

=IMPORTXML("http://www.cbr.ru/scripts/XML_daily.asp?date_req=11/05/2020"; "//ValCurs/Valute[CharCode=""USD""]/Value")


This link indicates the date and the value equal to the dollar rate on the specified day is substituted into the cell.
5eca72cbc69f6527993936.png

The question is: is it possible to automate the substitution of the date directly into the formula from the cell, so as not to do it manually? If yes, please tell me how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-05-27
@arr0w

The best way would be to use the TEXT formula

=IMPORTXML(
  "http://www.cbr.ru/scripts/XML_daily.asp?date_req=" & TEXT(A2;"DD/MM/YYYY");
  "//ValCurs/Valute[CharCode=""USD""]/Value"
)

5ece79bc8485c333632420.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question