Error with complex IF statements

Hello.

I am currently trying to write a detailed if statement for a form calculation but for the life of me cannot get it to work.

if(selected(${RoomStatus}, ‘Occupied’), 1, (if(selected(${RoomType}, ‘Meeting’) and (selected(${RoomStatus}, 'Occupied), ${Extra} + 1,(if(selected(${RoomStatus}, ‘Closed’), 0, 0))))))

I am fairly new with this so I may be going about this all wrong. I feel like im getting an error with the and statement, but im not sure why…Thanks in advance!

Hi,
Welcome to the community forum. Could you try this instead

if(selected(${RoomStatus}, ‘Occupied’), 1, (if((selected(${RoomType}, ‘Meeting’) and (selected(${RoomStatus}, 'Occupied))), ${Extra} + 1,(if(selected(${RoomStatus}, ‘Closed’), 0, 0)))))

Regards,
Stephane

1 Like