J
J
Julius1232022-03-15 15:03:59
Google Sheets
Julius123, 2022-03-15 15:03:59

How to use multiple checks in "IF" formula?

You need to use several IF checks and, depending on the currency in the cell, substitute your own formula. Now the formula looks like this

=ЕСЛИ(D4="UAH";1;ЕСЛИ(D4="USD";ПОДСТАВИТЬ(IMPORTXML("https://api.privatbank.ua/p24api/exchange_rates?date="&ТЕКСТ(A4;"DD.MM.YYYY");"//exchangerates/exchangerate[@currency='USD']/@saleRateNB");".";",";));ЕСЛИ(D4="EUR";ПОДСТАВИТЬ(IMPORTXML("https://api.privatbank.ua/p24api/exchange_rates?date="&ТЕКСТ(A4;"DD.MM.YYYY");"//exchangerates/exchangerate[@currency='EUR']/@saleRateNB");".";",";)))

But this error is given https://tppr.me/UwGWu
Moreover, if you use 2, not 3 IF, then everything works.
=ЕСЛИ(D3="UAH";1;ЕСЛИ(D3="USD";ПОДСТАВИТЬ(IMPORTXML("https://api.privatbank.ua/p24api/exchange_rates?date="&ТЕКСТ(A3;"DD.MM.YYYY");"//exchangerates/exchangerate[@currency='USD']/@saleRateNB");".";",";)))

Maybe someone can tell me what the problem is

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2022-03-15
@Julius123

Here is an extra bracket, it turns out the wrong number of arguments. The picture shows the correct solution.
6230a0cfac68d556657373.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question