Hello, I am new in excel programming ... and I need help.
I will simplify problem.
There are 3 cells:
A3 = 100,000
A4 = change every 1 min (connected with other source)
A5 = 50,000

A4 must be between A3 and A5, so I need to have that A4 keeps its own value except in situation when it is over then value in A3 or under then A5.

Example:
case A4 = 75,000 then 75,000
A4 = 150,000 then 100,000
A4 = 10,000 then 50,000

How to do that

Thanks in advance