change a cell value reference to another cell.

I need a formula to change a cell value with respect to another cell value. If “A1” is > “B1” then B1’s value should be replace with A1’s value.
for example
A1=10, B1=12 “initial value”
A1=15, B1=15 “change in B1 with respect to A1”
A1=13, B1=15 " no change if A1<B1"

Basically B1’s value should be depend on its own old value and A1’s values comparison.

If you will only enter data manually in the A1 cell, you can do it with a self referencing formula. Self referencing depends on enabling “iterative references”. See this help page.

Then you can enter the formula =MAX(A1;B1) in cell B1.

This is not quite the situation iterative/recursive formulas was intended for, so I don’t know whether this will be stable in all situations, but with integer values it seems stable enough.

If you need to have cell B1 also available for manual data entry, you cannot rely on a formula in B1. Can you have the input values separate from the calculation? Otherwise, a little macro programming seems to be required.