Dancul
Dancul

Reputation: 21

How to use nested IF and AND multiple conditioning

I want use nested IF with AND expression. But getting error. It is possible?

My example code: testing two values, if true return range,if not true test second two conditions if true return another range and so on...

=if(AND(Vstup!B16=150,Vstup!B17=0.8),{cennik!A4:G17},if(AND(Vstup!B16=150,Vstup!B17=1),{cennik!A26:G39))

Upvotes: 2

Views: 46

Answers (3)

andrewJames
andrewJames

Reputation: 21910

You have a typo in your formula near the end - there is a missing }:

=if(AND(Vstup!B16=150,Vstup!B17=0.8),{cennik!A4:G17},if(AND(Vstup!B16=150,Vstup!B17=1),{cennik!A26:G39}))

Upvotes: 1

player0
player0

Reputation: 1

try:

=INDEX(IF(AND(Vstup!B16=150; Vstup!B17=0.8); cennik!A4:G17;
       IF(AND(Vstup!B16=150, Vstup!B17=1);   cennik!A26:G39; )))

Upvotes: 0

Maciej Kaszkowiak
Maciej Kaszkowiak

Reputation: 33

Google Sheets formulas use semicolons as separators instead of commas.

Try this one:

=if(AND(Vstup!B16=150,Vstup!B17=0.8);{cennik!A4:G17};if(AND(Vstup!B16=150,Vstup!B17=1);{cennik!A26:G39))

Upvotes: 0

Related Questions