What I am trying to say is:

IF (AI8*A1+AI8)<AH8, then AH8, otherwise (AI8*A1+AI8) OR IF (AI8*A1+AI8)>AI8, then AI8, otherwise (AI8*A1+AI8)

If condition 1 is less than X, then Y OR If condition 2 is greater than O, then P, otherwise continue formula

The formula I wrote

=IF(OR((AI8*A1+AI8)<AH8,AH8,(AI8*A1+AI8)),IF(OR(AI8*A1+AI8)>AI8,AI8,(AI8*A1+AI8)))

I just don't seem to have the syntax right for what I am trying to accomplish.

Any help would be greatly appreciated.