How to write longer Formula in Band Math

Hello, could somebody help me how to write the following Excell quotation in Band Math?

=IF(NDVI<0;0.98;IF(AND(NDVI>=0;NDVI<0,2);0.92;IF(NDVI>0,5;0.99;0.92+(0.99-0.92)*Proportion_Vegetation)))

I tried this one, but it didn’t worked out because it says ‘unexpected keyword if’, because i guess it’s missing the ‘else’ from the ‘@ if @ then @ else @’ Operator:

if NDVI<0 then 0.98 or if NDVI >0 and NDVI < 0.2 then 0.92 or if NDVI > 0.5 then 0.99 else 0.92 + (0.99-0.92) * P_v

Try this one:
if NDVI<0 then 0.98 else if NDVI>0 and NDVI< 0.2 then 0.92 else if NDVI> 0.5 then 0.99 else (0.92 + (0.99-0.92) * P_v)

When expressions get too complicated, I often try to split them. Computing the various parts in different bands and then having one final expression which simply uses the bands.
This makes it often easier to manage them

1 Like

Great, this worked out, thanks a lot!!