I have a column that needs to return the value of another column based on if the value in a third column = S
You simply need to use IF statements: http://msdn.microsoft.com/en-us/library/bb862071.aspx
In addition to John's answer which seems best,
You can attach a Item Adding event to your list or you may able to use calculated columns.
Here's the code to give you an idea,