Referencing a cell as the "Then" part of an IF statement

I want to compare 2 cells, and then show the value in either of those cells, depending on which is lower. For example, if H4>C5, show C5, otherwise show H4.

Both these cells contain values, but anything I’ve found online just shows the text input in the formula. How do I get the IF statement to reference the numerical value in these 2 cells ?

To input a formula, you start with the equals sign. Your proposed “IF” use would be like:
=IF(H4>C5;C5;H4)

For this particular use, “show the lowest value”, there is another function:
=MIN(C5;H4)

Both of the above should yield exactly the same outcome.
Note that, depending on your selected locale, the semicolons may change to commas when you input my suggestions. This is normal behavior, not an error.

Ah, amazing. Everything I found was placing C5 in “”, which I think is what the problem was.

I’ll probably go with the MIN function though.

Thanks!