Welcome to the Community.
My suggestion is that you plot the data with the number of beds on the Y axis, and the number of baths on the Y axis and the number of beds on the X axis. Either Graph Builder of Fit Y by X will work for this. From there you should be able to see what the best estimates for baths should be.
You could also just use the mean value for the number of baths for each group of beds.
For Each Row(
If( Is Missing( :baths ),
:baths = Col Mean( :Baths, :Beds )
)
);
To handle your original specification, the script would be
For Each Row(
If( Is Missing( :baths ),
If(
:Beds <= 2, :Baths = 1,
:Beds == 3, :Baths = 2,
:Beds <= 5, :Baths = 3,
:Beds <= 8, :Baths = 4,
:Baths = 5
)
)
);
Jim